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.
Where does a Person come from?
- 3
Locked
Comments (56)
- Popular
- New
- Old
You must be signed in to leave a comment
NightroWave
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.
0
William Pel
3 October 2021, 01:26
+2
Dav
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.
0
David Cáceres
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.
0
Anonymous #10755035
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!!!
0
MasterApprentice
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?
+1
Roman
31 December 2020, 06:17
Please post your question with the attached solution in the section Help.
0
Pina
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
0
Renz dela Paz
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.
0
anupam jha
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.
0
Roman
19 October 2020, 04:18
Please post your question with the attached solution in the section Help.
0
Bhargav
24 June 2020, 02:07
how to call a class in another class?
help me please.
+1
JMontrose
19 September 2020, 16:23
+1
AlasCaras
4 February 2021, 19:23
This was helpful. Thanks JMontrose..
0
Rolphson S
2 May 2020, 03:14
I need help asap. I cant figure out what to do.
+1
Massimo Lorenzi
21 April 2020, 13:49
perchè non riconosce il metodo person ?
0