JAVA QUIZ 5 32 Created on May 07, 2020 By Sirjana GhimireAcharya JAVA QUIZ 5 1 / 10 1.What will be the output of Round(3.7). 4 3.7 3 0 2 / 10 2. How do you insert COMMENTS in Java code? /* This is a comment // This is a comment # This is a comment 3 / 10 3. What guarantees type-safety in a collection? Abstract classes Generics Interfaces Collection 4 / 10 4.Does Java supports goto? Yes No 5 / 10 5. Which of the following is true for an object having no reference variables referring to it? It is swapped out to disk. It stays in main memory forever. The garbage collector lets its memory usable for new objects. It goes back to String pool. 6 / 10 6. Which of the following is FALSE about arrays on Java A java array is always an object Length of array can be changed after creation of array Arrays in Java are always allocated on heap 7 / 10 7. Output of following Java program?class Test{public static void main (String[] args){int arr1[] = {1, 2, 3};int arr2[] = {1, 2, 3};if (arr1 == arr2)System.out.println("Same");elseSystem.out.println("Not same");}} Same Not Same 8 / 10 8.What is the result of the below lines of code?class ascii_to_String {public static void main(String args[]){int ascii[] = { 65, 66, 67, 68};String str = new String(ascii, 1, 3);System.out.println(str);}} ABC BCD CDA ABCD 9 / 10 9.Which of the following is the correct difference in String on C and Java? C String is a primitive data type while String in Java is an Object. C String is a null terminated character array while String in Java is an Object. C String and Java String are completely different to each other. None of these are correct. 10 / 10 10. Is JDK required on each machine to run a Java program? Yes No Your score is The average score is 60% LinkedIn Facebook Twitter 0% Restart quiz