Q: Shorthand array initialization in Java needs the keyword "new" to allocate memory to the array and elements. State TRUE or FALSE.
Solution: Only lazy initialization of array needs the keyword "new" to allocate memory.
Q: Lazy initialization of array requires the keyword "new" to allocate memory to the array and its elements. State TRUE or FALSE.
Solution: int[] ary; ary = new int[5];
Q: What is the default value of an element of Object type array?
Solution: Objects can be String, ArrayList, HashMap, HashSet etc.
Q: What is the default value of byte, short, int or long data type elements of an array in Java?
Solution: no solution
Q: What is the default value of float or double data type elements of an array in Java?
Solution: no solution
Q: What is the default value of boolean data type elements of an array in Java?
Solution: no solution
Q: Allocating memory with the keyword "new" causes the array elements to carry default values. State TRUE or FALSE.
Solution: no solution
Q: What is the output of the below Java program? int balls[], rounds=3; balls = new int[rounds]; for(int i=0; i
Solution: no solution
Q: What is the output of the below Java program with arrays? String[] ary = {"KITE", "AIR"}; String str = "PLANE"; ary[1] = str; str = "FLY"; System.out.println(ary[1]);
Solution: no solution
You Have Score    | /9 |