25. A method that is associated with an individual object is called ________. a) an object method b) a static method c) an instance method d) a class method
Blog
q34. What is the output of the code?
q34. What is the output of the code?
5. What is the output of the following code? a. 56 b. 67 c…
5. What is the output of the following code? a. 56 b. 67 c. 5 d. 6 e. None of the above
24. Variables that are shared by every instances of a class…
24. Variables that are shared by every instances of a class are ________. a) static variables b) public variables c) instance variables d) private variables
13. How can you initialize an array of two characters to ‘a’…
13. How can you initialize an array of two characters to ‘a’ and ‘b’? a. char[] charArray = new char[2]; charArray = {‘a’, ‘b’}; b. char[2] charArray = {‘a’, ‘b’}; c. char[] charArray = {‘a’, ‘b’}; d. all of the above
q31. What is the output of the code?
q31. What is the output of the code?
24. Variables that are shared by every instances of a class…
24. Variables that are shared by every instances of a class are ________. a) static variables b) public variables c) instance variables d) private variables
15. Which of the following statements are true? a. Data fiel…
15. Which of the following statements are true? a. Data fields do not have default values. b. Local variables have default values. c. A variable of a primitive type holds a reference to the value of the primitive type. d. A variable of a reference type holds a reference to where an object is stored in the memory. e. All of the above.
20. Which of the following statements are true? a) Construct…
20. Which of the following statements are true? a) Constructors must have the same name as the class itself. b) Multiple constructors can be defined in a class. c) Constructors are invoked using the new operator when an object is created. d) Constructors do not have a return type, not even void. e) All of the above
7. The following syntax declares a three-dimensional array v…
7. The following syntax declares a three-dimensional array variable scores, creates an array, and assigns its reference to scores: double[ ][ ] [ ] x = new double[2][3][4]; What is the output of x[0][0].length: a. 2 b. 3 c. 4 d. None of the above