Results 1 to 3 of 3
  1. #1
    nikki is offline Member
    Join Date
    Jun 2010
    Posts
    1
    Rep Power
    0

    Default Please help me with the main method

    Hello I'm new to programming and have written a simple slide show which contains changeImage()
    I am now trying to write the Main class. I thought you had to call a method from the class you want to open but it wont work.
    Below is what I have already written in the Main class and please help me!!!

    public class Main
    {
    public static void main(String[] args)
    {
    SlideShow open = new SlideShow();
    }
    }

  2. #2
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    Unfortunately no one will be able to help you with the little bit of information that you've provided. Please tell the details.

  3. #3
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default

    what you've wrote there is a reference to a class called slideshow using an object called open and its been initialised.

    have you made the class slideshow yet?

    if not make it, and your object should initialise no problem.

    once you've made it you can write a bunch of methods inside the slideshow class such as

    PHP Code:
    public class Main {
    
    
        public static void main(String[] args) {
            
           
            SlideShow open = new SlideShow();  //initialise object
            open.change();                             //calling a method 
        }
    
    }

    PHP Code:
    public class SlideShow {
    
        
        //an example of a method within the slideShow class
        public void change(){
            //some code  
        }
        
        
    }
    Teaching myself java so that i can eventually join the industry! Started in June 2010

Similar Threads

  1. Main Method Help
    By thomas6 in forum New To Java
    Replies: 0
    Last Post: 03-12-2010, 02:20 AM
  2. Help with main method
    By eliCanzee in forum JDBC
    Replies: 4
    Last Post: 01-06-2010, 10:12 AM
  3. calling method from main method
    By bob_bee in forum New To Java
    Replies: 4
    Last Post: 10-02-2009, 06:30 PM
  4. Where do I put main method?
    By jerryrice80 in forum New To Java
    Replies: 4
    Last Post: 09-16-2009, 09:23 PM
  5. Main method here to :S:S hlp pls
    By eliCanzee in forum AWT / Swing
    Replies: 6
    Last Post: 05-27-2009, 05:45 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •