Which of the following statements accurately describe the use of access modifiers within a class definition?

a.They can be applied to both data & methods
b.They must precede a class's data variables or methods
c.They can follow a class's data variables or methods
d.They can appear in any order
e.They must be applied to data variables first and then to methods
Ans:a,b,d.

Suppose a given instance variable has been declared private. Can this instance variable be manipulated by methods out side its class?

a.yes
b.no
Ans:b.

Which of the following statements can be used to describe a public method?

a.It is accessible to all other classes in the hierarchy
b.It is accessablde only to subclasses of its parent class
c.It represents the public interface of its class
d.The only way to gain access to this method is by calling one of the public class methods
Ans:a,c.

Which of the following types of class members can be part of the internal part of a class?

a.Public instance variables
b.Private instance variables
c.Public methods
d.Private methods
Ans:b,d.

You would use the ____ operator to create a single instance of a named class.

a.new
b.dot
Ans:a.

Which of the following statements correctly describes the relation between an object and the instance variable it stores?

a.Each new object has its own distinctive set of instance variables
b.Each object has a copy of the instance variables of its class
c.the instance variable of each object are seperate from the variables of other objects
d.The instance variables of each object are stored together with the variables of other objects
Ans:a,b,c.

If no input parameters are specified in a method declaration then the declaration will include __.

a.an empty set of parantheses
b.the term void
Ans:a.

What are the functions of the dot(.) operator?

a.It enables you to access instance variables of any objects within a class
b.It enables you to store values in instance variables of an object
c.It is used to call object methods
d.It is to create a new object
Ans:a,b,c.

Which of the following can be referenced by this variable?

a.The instance variables of a class only
b.The methods of a class only
c.The instance variables and methods of a class
Ans:c.

The this reference is used in conjunction with ___methods.

a.static
b.non-static
Ans:b.

Which of the following operators are used in conjunction with the this and super references?

a.The new operator
b.The instanceof operator
c.The dot operator
Ans:c.

A constructor is automatically called when an object is instantiated

a)True
b)False
Ans:a.

When may a constructor be called without specifying arguments?

a. When the default constructor is not called
b. When the name of the constructor differs from that of the class
c. When there are no constructors for the class
Ans:c.

Each class in java can have a finalizer method

a)True
b)False
Ans:a.

When an object is referenced, does this mean that it has been identified by the finalizer method for garbage collection?

a)yes
b)no
Ans:b.

Google