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: This will be an easy one.

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default This will be an easy one.

    Greetings! My name is Pedro and I am very interested in the java language, I have prior experience with other things such as HTML CSS Ect. This is my first post of the forum and I'm veryexcited to actually make better posts in the nearby future. I apologize if I broke any forum protocol by coming here first.. I've been programming for about two weeks now and I really can't understand anything unless a more advanced person helps me and some concepts really confuse me! I am looking at this problem and I think I'm overthinking it sometimes that hinders my ability too.. Anyway: the problem reads; create an EvergladesFire class with two constructors and a default size of 1 acre. (this is killing me, I'm not very good at assigning them) create methods windyDay( acres ) to make the fire get larger and rainStorm( acres ) to make smaller. Create a method extinguishFire() that sets fire size to 0. I get the methods but I'm having problems with writing the constructors. Can I please get some help? I'll post what I have so far when I get home. I'm on an iPod


  2. #2
    Member
    Join Date
    Jun 2011
    Posts
    56
    Thanks
    2
    Thanked 7 Times in 6 Posts

    Default Re: This will be an easy one.

    Quote Originally Posted by Pedroski View Post
    Anyway: the problem reads; create an EvergladesFire class with two constructors and a default size of 1 acre. (this is killing me, I'm not very good at assigning them) create methods windyDay( acres ) to make the fire get larger and rainStorm( acres ) to make smaller. Create a method extinguishFire() that sets fire size to 0. I get the methods but I'm having problems with writing the constructors. Can I please get some help? I'll post what I have so far when I get home. I'm on an iPod
    You would need two overloaded constructors. The default constructor takes no parameters and you would set acres to 1 there.
    The other one accepts an acres value and sets the class member value accordingly. Something like:
    EvergladesFire() {acres_ = 1.}
    EvergladesFire(double acres) {acres_ = acres}

  3. #3
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: This will be an easy one.

    Quote Originally Posted by Pedroski View Post
    Greetings! My name is Pedro and I am very interested in the java language, I have prior experience with other things such as HTML CSS Ect. This is my first post of the forum and I'm veryexcited to actually make better posts in the nearby future. I apologize if I broke any forum protocol by coming here first.. I've been programming for about two weeks now and I really can't understand anything unless a more advanced person helps me and some concepts really confuse me! I am looking at this problem and I think I'm overthinking it sometimes that hinders my ability too.. Anyway: the problem reads; create an EvergladesFire class with two constructors and a default size of 1 acre. (this is killing me, I'm not very good at assigning them) create methods windyDay( acres ) to make the fire get larger and rainStorm( acres ) to make smaller. Create a method extinguishFire() that sets fire size to 0. I get the methods but I'm having problems with writing the constructors. Can I please get some help? I'll post what I have so far when I get home. I'm on an iPod
    So, did you create the classes and constructors?
    And what is the problem, you are facing now?

Similar Threads

  1. Little easy to fix problem
    By adammint7 in forum Java Theory & Questions
    Replies: 9
    Last Post: April 14th, 2011, 10:07 AM
  2. Easy help but can't figure it out.
    By weezer562 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: October 19th, 2010, 09:50 PM
  3. My Custom Layout (VERY EASY TO USE)
    By aussiemcgr in forum AWT / Java Swing
    Replies: 10
    Last Post: August 5th, 2010, 01:37 PM
  4. A Few Quick, Easy Questions
    By TheAsianMenace in forum Object Oriented Programming
    Replies: 1
    Last Post: February 24th, 2010, 02:47 PM
  5. String + Compare // Might be too easy for ya
    By Jangan in forum Java Theory & Questions
    Replies: 1
    Last Post: October 18th, 2009, 05:40 PM