+ 1

Java! Need help with terminology

Badly need help with this matching. All the best to everyone who can help. I passed a terrible quiz, but this question is the only one that I can't take. public class Person { private char gender; static int number; //... public static void main(String[] args) { Person person; //... } public static void callPerson(int hours) { double payRate = 24.99; } } The code above compiles okay. Refer to it to complete this matching exercise. number is ____ hours is ____ gender is ____ person is _____ payRate is _____ Options: 1. local reference variable 2. class variable 3. instance variable 4. parameter 5. local primitive variable

19th Jun 2018, 4:08 AM
DIY Mods
DIY Mods - avatar
2 ответов
+ 1
number is defined in class and static, so it belong to any instance of the class, so it's class variable hours is passed to the function on call, so it's parameter gender is defined in the class, but it's not static, so it belongs to certain class instance, so it's instance variable person is an instance of a class, defined inside a method, so it's local reference varible payRate is an instance of a primitive type, defined inside a method, so it's local primitive variable
19th Jun 2018, 4:19 AM
Дмитро Іванов
Дмитро Іванов - avatar
0
Дуже дякую!)
19th Jun 2018, 4:40 AM
DIY Mods
DIY Mods - avatar