Advertisement
Advertisement
11th Grade Java Quizzes, Questions & Answers
Recent Java Quizzes
Questions: 15 | Attempts: 4789 | Last updated: Jul 3, 2025
-
Sample QuestionAll data members in an interface are by default
Questions: 100 | Attempts: 5453 | Last updated: Sep 18, 2025
-
Sample QuestionWhat will be the result of compiling the following program? public class MyClass { long var; public void MyClass(long param) { var = param; } // (Line no 1) public static void main(String[] args) { MyClass a, b; a = new MyClass(); // (Line no 2) } } 1.A compilation error will occur at (Line no 1), since constructors cannot specify a return value 2.A compilation error will occur at (2), since the class does not have a default constructor 3.A compilation error will occur at (Line no 2), since the class does not have a constructor that takes one argument of type int. 4.The program will compile without errors.
Questions: 10 | Attempts: 1012 | Last updated: Mar 22, 2025
-
Sample QuestionWhat of the following is the default value of an instance variable?
Questions: 10 | Attempts: 116 | Last updated: Feb 13, 2025
-
Sample QuestionIn Java, each thread has its own ________, in which it runs?
Questions: 10 | Attempts: 544 | Last updated: Mar 22, 2025
-
Sample QuestionGiven the code fragment: int nums1[] = new int[3]; int nums2[] = {1,2,3,4,5}; nums1 = nums2; for (int x : nums1) { System.out.print(x + ": "); } What is the result?
Questions: 5 | Attempts: 215 | Last updated: Mar 22, 2025
-
Sample QuestionGiven the code snippet from a compiled Java source file: public class MyFile{ public static void main(String[] args) { String arg1 = args[1]; String arg2 = args[2]; String arg3 = args[3]; System.out.println("Arg is "+ arg3); } } Which command-line arguments should you pass to the program to obtain the following result? Arg is 2
Questions: 11 | Attempts: 119 | Last updated: Mar 19, 2025
-
Sample QuestionOne of the following is regarded as one of the most powerful basic data structures?
Questions: 10 | Attempts: 1046 | Last updated: Oct 16, 2025
-
Sample QuestionThe Swing is an API for providing a graphical user interface for
Questions: 10 | Attempts: 1094 | Last updated: Mar 21, 2025
-
Sample QuestionGroovy is an object oriented programming language for...
Questions: 6 | Attempts: 307 | Last updated: Mar 21, 2025
-
Sample QuestionWhich of the following are true about Exceptions in the Java language?
Advertisement