Where does a Person come from?

  • 3
  • Locked
In Java, people come from the same place that other classes come from: from the programmer's head. It is important for the creator of a class to think through what is important for the class and what is not. If he or she does, then the class will make sense and be useful. Let's begin. Let's create a Person class that allows our Person to have a name, age, weight, and... money. And then we'll create an object.
You can't complete this task, because you're not signed in.
Comments (56)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Level 3 , San Francisco, Norway
15 March, 16:50
Es complicado de entender de primeras por lo redundante que es. Lo mejor que puedes hacer es seguir las instrucciones paso a paso. Lo "complicado" está en el método Main, donde tendrás que crear un objeto (el que indica el ejercicio en la segunda parte) repitiendo una misma palabra. Cuidado con dejarse las mayúsculas.
William Pel
Level 4 , Guatemala
3 October 2021, 01:26
Person person = new Person()
Level 2 , United States of America
26 October 2021, 15:40
So, in this case in the example "VariableType variableName = new TypeOfObjectBeingCreated();" they are saying VariableType is in the broadest meaning, including objects? Not sure how long it would have taken me to try that combination. 👍 kinda gives it away though.
9 August 2021, 05:22
Oh wow coding is really unforgiving, everything was fine except i forgot a cap letter on person lol, still really interesting though, can't wait to learn more.
Anonymous #10755035
Level 3 , Paris, France
16 June 2021, 23:06
Hint here: the word "immediately" means you must assign the object Person to the new variable person all in ONE line!!!
Level 3 , Serbia
28 December 2020, 14:06
Sooo, when I tried to verify, it kept telling me that the problem is in the main method(the part where I was to create the Person object), however it turned out that the problem was in the Person class... Anyone happen to know why it was so?
Level 41
31 December 2020, 06:17
Please post your question with the attached solution in the section Help.
27 January, 16:56
I have the same problem. it gives me error in public class main and in "help" I can't find anything
Renz dela Paz
Level 2 , Malolos, Philippines
31 October 2020, 03:45
for those who are in creating a new object, I suggest you re-read that Cat example from this lesson. only the first line fulfilled the main method condition. hope this helps as a hint.
anupam jha
Level 7 , India
16 October 2020, 12:59
in the person class created 3 int variables . one string var..in the main method created person object. Person p = new Person(); whats wrong ?? not sure i m.pls clear my confusion.Thanks.
Level 41
19 October 2020, 04:18
Please post your question with the attached solution in the section Help.
Level 7 , Mountain View, United States
24 June 2020, 02:07
how to call a class in another class? help me please.
Level 3 , Beaumont, United States
19 September 2020, 16:23
VariableType variableName = new TypeOfObjectBeingCreated();
Level 4 , Corpus Christi, United States
4 February 2021, 19:23
This was helpful. Thanks JMontrose..
Rolphson S
Level 2 , New York City, United States
2 May 2020, 03:14
I need help asap. I cant figure out what to do.
Massimo Lorenzi
Level 2 , Milan, Italy
21 April 2020, 13:49
perchè non riconosce il metodo person ?