Hello I am learning Java at my spare time as a hobby. It only been a week and at the moment I am trying to get my head around the following things fields, constructor, accessors etc.
There is an exercise which I ma having trouble with:
Human
1. Create a human class
2. This class has fields to hold name, age, color and temperament.
3. The constructor takes as parameters values for all the fields above and a constructor that takes only a name and sets the age field to 1 and color to blue and temperament to happy
4. Human has methods to set and get each of the field described above and in addition two methods named. Yessss and Nooo which will print out "Yess" and "Nooo" on the terminal window. there is also a method named markeSound will display Yesss if the human is happy or Noooo if he is sad.
this is how far I have progressed, I am not sure If I am doing this properly.
public class Human{
String name, age, colour, temperament;
}
Can someone help me out please.
Thanks in advance
By the way I am using BlueJ