- 1

Why is int used in while it is not a variable that stores characters in object creating

My question is why when you are creating a class or object in java one uses int variable to describe the object while it doesn't store character variables.I have an example;private int wheels;

31st Dec 2021, 7:18 PM
Reddrez
Reddrez - avatar
3 Antworten
+ 1
I don't understand your question, can you explain please? int is for integer, it is a number char is for character, it is a "letter"
31st Dec 2021, 7:25 PM
Lisa
Lisa - avatar
+ 1
Complete your example. 'private int wheels;' can be many things.
31st Dec 2021, 8:48 PM
Emerson Prado
Emerson Prado - avatar