few questions please help and give correct answers:) 1. Consider the following i
ID: 3700329 • Letter: F
Question
few questions please help and give correct answers:)
1. Consider the following incomplete class. (2points) public class SomeClass public static final int VALUE! = 30, public static int value2 10 private int value3 = 5. private double value4 3.14, public static void someMethodo /implementation not shown public void someOtherMethodO implementation not shown Which of the following is a class constant? VALUE value2 value3 value4 someOtherMethod Multiple Choice 2. Consider the following incomplete class (2 points public class SomeClassExplanation / Answer
Question 1)
VALUE1 is class constant.
Reason: it is declared as final so its value cannot be changed and it is static which was a class level variable.
Question 2)
VALUE1 and value2 can be accessed without creating object since they are static variables.
Question3)
The method is accessible only by using a previously instantiated SomeClass object.
Question4)
SOME_VALUE is a static variable since we have accessed that with class name.
Question 5)
4 is the right answer.
here in this code we have inserted 3 elements to a and 1 element to b. But a size will be 4 only because we have directly assigned a to b which is a shallow copy.
In the memory both will point to same location only so changes made in one will be reflected in other.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.