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 3 of 3

Thread: Working with a constructor class.

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Location
    Bristol, TN
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Working with a constructor class.

    System.out.println("\nStudentType:     "  );
    cStudentType = kb.nextChar();  It does not like this code at all:

    I keep getting error messages and I cannot figure it out. Any ideas, suggestions, would greatly be appreciated.
    Thank you for any help you can give me.


  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    571
    My Mood
    Sleepy
    Thanks
    9
    Thanked 84 Times in 78 Posts

    Default Re: Working with a constructor class.

    I bet the compile doesn't say:"It does not like this code at all". Post the exact error message or stack trace.

  3. #3
    Member Zyrion's Avatar
    Join Date
    Feb 2013
    Location
    Iowa
    Posts
    106
    My Mood
    Angelic
    Thanks
    2
    Thanked 8 Times in 8 Posts

    Default Re: Working with a constructor class.

    You are using the reference 'kb' to the class, Scanner I assume. You are attempting to use a method that is nonexistent in that specific class.

    Take a look here for more information on the Scanner class: Scanner Class

Similar Threads

  1. **Constructor in class cannot be applied to given types;...
    By bassie in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 2nd, 2012, 02:15 PM
  2. add a default constructor in abstract class
    By Kifli in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 8th, 2012, 12:42 AM
  3. which class has a default constructor? (Req. guidance on constructor)
    By DragBall in forum Java Theory & Questions
    Replies: 1
    Last Post: June 27th, 2012, 04:42 PM
  4. [SOLVED] Class constructor default values
    By srs in forum Java Theory & Questions
    Replies: 3
    Last Post: November 25th, 2010, 08:51 PM
  5. Construct a class that implement ActionListener with no constructor
    By striko_514 in forum Java Theory & Questions
    Replies: 1
    Last Post: July 5th, 2010, 03:15 PM