Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: error in my java program

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default error in my java program

    Class Test
    {
    	 Test()
    	{
    	 this(5)
    	 System.out.println("default constructor called");
    	}
     
    	Test(int x)
            {
    	 this(10,20)
    	 System.out.println(x);
    	}
     
    	Test(int x , int y)
    	{
    	 System.out.println(x+y);
    	}
     
     
    public static void main(String...s)
    	{
            Test t = new Test();
    	}
    }
    error.jpg
    Last edited by jps; August 30th, 2013 at 05:21 AM. Reason: code tags


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: error in my java program

    Welcome to the forum
    Please use code tags when posting code. Help can be found on the Announcements page
    Always post the full text of the error message with your code and question.
    (Copy paste the error message, those tiny pictures are so hard to read)

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: error in my java program

    And be specific about what you need help with. Explain your confusion, ask questions, be a person instead of a posting robot that expects the answer bot to figure everything out and come to your rescue.

  4. The Following User Says Thank You to GregBrannon For This Useful Post:

    PhHein (August 30th, 2013)

  5. #4
    Junior Member
    Join Date
    Sep 2012
    Posts
    20
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: error in my java program

    hi I'm a newbie java learner

    here's what I can see from your codes

    "Class Test" ? not "public class test"?

    where's your semicolon on ending of lines?

    your code'soutput supposed to be like below?
    30
    5
    default constructor called

Similar Threads

  1. My Java program gets a strange error
    By 119mikkel in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 12th, 2013, 11:47 AM
  2. [SOLVED] Java Simple Rectangle Program Error
    By XP360 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 22nd, 2013, 11:07 PM
  3. Replies: 1
    Last Post: January 17th, 2013, 07:04 AM
  4. Java Error cannot be applied to (java.lang.String), phone book entry program.
    By iceyferrara in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 23rd, 2011, 06:32 AM
  5. [SOLVED] Java program error in displaying Output
    By crazydeo in forum AWT / Java Swing
    Replies: 9
    Last Post: May 14th, 2008, 10:42 AM