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: House/Room Classes

  1. #1
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: House/Room Classes

    Implement a method to read in room information in the House class from the keyboard — this should call the Room constructor as required. Modify the Create a zero-argument House constructor to call this new method.
    Which part are you having problems with?
    Create a method
    read in room info
    call Room constructor
    create 0 arg House constructor
    call the method

    Please edit your post and wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.


  2. #2
    Junior Member
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: House/Room Classes

    "Create a method
    read in room info
    call Room constructor"

    The first three you mentioned.

    Done

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: House/Room Classes

    See the tutorial about how to define/create a method:
    Defining Methods (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

    To read input from the console see the Scanner class.
    If you want a dialog window see the JOptionPane class.

    Use the new statement to call a constructor.
    Creating Objects (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
    Passing Information to a Method or a Constructor (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Full House help?
    By jean28 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 10th, 2012, 02:57 AM
  2. Chat Room in JSP
    By c.P.u1 in forum JavaServer Pages: JSP & JSTL
    Replies: 8
    Last Post: July 7th, 2011, 07:14 PM