I'm having a huge issue with what should be a simple question:
Identify primitive instance variables and class variables from below code
class StudentDetails { Int rollnumber; String studentname; } StudentDetails firststudent = new StudentDetails(19236, "Thomas");
My original submission was sent back to me because I described what primitive instance variables and class variables were and I think I identified them incorrectly. The comments returned state "clearly state which variables are primitive instance variables (there is 1) and which are class variables (there is 1)."
Now I must have read 10 different articles/posts explaining what instance variables and class variables are and I'm still confused in regards to the class variable in question.
In all the examples I've seen, class variables are declared with the static keyword in a class, but outside a method, constructor or a block. In this question there is no static keyword. Is it implied somehow? Is it not required for class variables?
I assume the string studentname is the class variable simply because the int rollnumber is the primitive variable. However, I'm not certain and want to understand the answer.
My concepts for identifying class variables are comes from sites such as: