hello, I have a silly question but I'm just getting started in java and I don't understand why sometimes a variable is declared without first declaring what type of variable it is, such as Person person; or Cat cat = new cat(); I would appreciate if someone could clarify it for me
how to declare variables
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
nygram
19 August 2022, 09:13
When you write:
int num;
Yoy say num is an integer
When you write:
Person person;
You say person is an instance of Person,
type of person? -> Person
0