Question: JAVA Multiple Choice- Choose the best answer from the choices given 1.When an argument is passed by value, A. The parameter variable holds the address

JAVA

Multiple Choice- Choose the best answer from the choices given

1.When an argument is passed by value, A. The parameter variable holds the address of the argument. B. The parameter variable cannot be changed. C. The parameter variable holds a copy of the value passed to it. D.Changes can be made to the argument variable.

2.If you do not provide initialization values for a class's numeric fields, they will A.Cause a runtime error. B.Contain an unknown value. C.Be automatically initialized with 0. D. Cause a compiler error.

3.Each time a method is invoked, the system stores parameters and local variables in an area of memory, known as _______, which stores elements in last-in first-out fashion.

A.a heap B.a stack C.an array D.storage area

4.The signature of a method consists of ________. A.method name B.method name and parameter list C.parameter list D.return type, method name, and parameter list

5.Overloading is A.writing a method that does too much processing. B.writing a program that is too large to fit in memory. C.having two or more methods with the same signature. D.having two or more methods with the same name, but different signatures.

6.A method's signature consists of A.the method name and the parameter list. B.the return type, the method name, and the parameter list. C.the size of the method in memory. D.the return type and the method name.

7.The only limitation that static methods have is A.they must be declared outside of the class. B.they cannot refer to nonstatic members of the class. C.they can only be called from static members of the class. D.they can refer to only nonstatic members of the class.

8.Assuming the following declaration exists:enum Tree { OAK, MAPLE, PINE } What will the following code display? System.out.println(Tree.OAK); A.OAK B.Tree.OAK C.A memory address D.null

9.When a field is declared static, there will be A.a copy of the field for each method in the class. B.a copy of the field in each class object. C.only one copy of the field in memory. D.two reference copies of the field for each method in the class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!