49.0k views
1 vote
1- Which of the following is the java keyword used to declare a class?

a) class
b) object
c) instance
d) instantiate

1- Which statement about constructors is false?

a) A constructor is invoked to create a new object
b) A constructor has the same name as the class to which it belongs.
c) A constructor can have any return type.
d) A class can have more than one constructor

3- A class may declare variables that instances of the class will all have. However, each instance can have different values assigned to those variables. Which term best describes these variables?

a) primitive variables
b) class variables
c) reference variables
d) instance variables

4- Which type of variable holds a reference to an object?

a) instance variable
b) reference variable
c) primitive variable
d) class variable

5- Which of the following is the java keyword used to create an object?

a) create
b) original
c) new
d) make

User Ujizin
by
5.2k points

2 Answers

4 votes
1. a)
2. c)
3. d)
4. b)
5. And this is is either a/d
Hope this is all right!
User Mayukh Sarkar
by
4.6k points
4 votes
1) a, you write class Foo { ... }
2) c, a constructor does not have a return type
3) d, every instance gets its own copy
4) b, a reference variable. Ofcourse, an instance or class variable may or may not be a reference variable.
5) c, the new keyword instantiates objects.
User ElusivDangerBoy
by
5.4k points