- Get link
- X
- Other Apps
ICSE Board Standard 10th Computer Applications Subject 50 MCQ Questions
1. What is Java?
- A. A coffee brand
- B. A programming language
- C. A type of computer
- D. A city in Indonesia
2. Which of the following is a feature of Java?
- A. Pointers
- B. Garbage Collection
- C. Multiple Inheritance
- D. All of the above
3. Which keyword is used for inheritance in Java?
- A. super
- B. this
- C. extends
- D. implements
4. What is the purpose of the 'static' keyword in Java?
- A. To declare a constant variable
- B. To create a static method
- C. To allocate memory
- D. To refer to the current object
5. Which method is called when an object is created in Java?
- A. init()
- B. start()
- C. main()
- D. constructor()
6. What is the output of the following code snippet?
String str = "Hello, World!";System.out.println(str.charAt(7));- A. 'W'
- B. 'r'
- C. 'o'
- D. 'l'
7. Which of the following is a valid declaration of a String in Java?
- A. String s = "Hello";
- B. String s = new String("Hello");
- C. Both A and B
- D. None of the above
8. What is the default value of a local variable in Java?
- A. 0
- B. Null
- C. Depends on the type
- D. Garbage value
9. Which of the following is true about the 'break' statement in Java?
- A. It is used to exit a loop
- B. It is used to skip the next iteration of a loop
- C. It is used to terminate a program
- D. It is used to define a label
10. What is the purpose of the 'super' keyword in Java?
- A. To refer to the superclass
- B. To access static variables
- C. To create an object
- D. To invoke the current object
11. What does JVM stand for in Java?
- A. Java Virtual Machine
- B. Java Visual Machine
- C. Java Virtual Memory
- D. Java Versioning Machine
12. Which of the following is a wrapper class in Java?
- A. Int
- B. Float
- C. Char
- D. Bool
13. What is the purpose of the 'final' keyword in Java?
- A. To declare a constant variable
- B. To make a class immutable
- C. To indicate the end of a program
- D. To create an object
14. Which collection class allows the use of duplicate elements in Java?
- A. Set
- B. List
- C. Map
- D. All of the above
15. What is the output of the following code snippet?
int x = 5;int y = 2;System.out.println(x / y);- A. 2.5
- B. 2
- C. 2.0
- D. 2.5 (truncated)
16. What is the purpose of the 'this' keyword in Java?
- A. To refer to the current object
- B. To access static variables
- C. To create an object
- D. To invoke the superclass
17. Which of the following is a type of exception in Java?
- A. Checked exception
- B. Unchecked exception
- C. Both A and B
- D. None of the above
18. What is the role of the 'implements' keyword in Java?
- A. To define a class
- B. To implement an interface
- C. To access instance variables
- D. To create an object
19. Which operator is used for conditional assignment in Java?
- A. =
- B. +=
- C. ?:
- D. ==
20. What is the purpose of the 'continue' statement in Java?
- A. To exit a loop
- B. To skip the next iteration of a loop
- C. To terminate a program
- D. To define a label
21. How do you create an array in Java?
- A. int array = new int[];
- B. int[] array = new int[];
- C. int[] array = new int[5];
- D. array int[5];
22. Which class is the superclass of all classes in Java?
- A. Object
- B. Class
- C. Superclass
- D. Main
23. What is the purpose of the 'toString()' method in Java?
- A. To convert an object to a string
- B. To convert a string to an object
- C. To print the object's memory address
- D. To access a static variable
24. What is the default value of a boolean variable in Java?
- A. true
- B. false
- C. 0
- D. Null
25. Which keyword is used to prevent a method from being overridden in Java?
- A. override
- B. final
- C. abstract
- D. super
26. What is the purpose of the 'throw' keyword in Java?
- A. To create an exception
- B. To catch an exception
- C. To exit a loop
- D. To skip the next iteration of a loop
27. What is the difference between '==' and '.equals()' in Java?
- A. They are used interchangeably
- B. '==' compares object references, '.equals()' compares content
- C. '==' is used for integers, '.equals()' for objects
- D. '.equals()' is used for integers, '==' for objects
28. What is the purpose of the 'interface' keyword in Java?
- A. To create an object
- B. To define a class
- C. To implement an interface
- D. To access instance variables
29. Which of the following is a valid declaration of a two-dimensional array in Java?
- A. int[][] array = new int[][];
- B. int[][] array = new int[5][5];
- C. int array[][] = new int[5][5];
- D. Both B and C
30. What is the output of the following code snippet?
int x = 3;int y = 5;System.out.println("Sum: " + x + y);- A. Sum: 8
- B. Sum: 35
- C. Sum: 3 + 5
- D. Sum: 35 (concatenation)
31. Which of the following is used to handle multiple exceptions in Java?
- A. try-catch block
- B. catch-try block
- C. try-except block
- D. catch-except block
32. What is the purpose of the 'this()' constructor call in Java?
- A. To invoke the superclass constructor
- B. To invoke the current object's constructor
- C. To create an object
- D. To access static variables
33. What is the role of the 'instanceof' operator in Java?
- A. To check if an object is an instance of a specific class
- B. To convert an object to a different class
- C. To compare two objects
- D. To check if an object is null
34. How do you define a constant in Java?
- A. Using the 'constant' keyword
- B. Using the 'final' keyword
- C. Using the 'const' keyword
- D. Constants are not allowed in Java
35. Which of the following is true about the 'do-while' loop in Java?
- A. It always executes at least once
- B. It is used for infinite loops
- C. It is not a loop construct in Java
- D. It is used for skipping the next iteration
36. What is the purpose of the 'clone()' method in Java?
- A. To create a shallow copy of an object
- B. To create a deep copy of an object
- C. To access a static variable
- D. To convert an object to a string
37. Which of the following is true about Java's 'switch' statement?
- A. It can be used for complex conditions
- B. It does not support the 'break' statement
- C. It can only be used with integers or enumerated types
- D. It is interchangeable with the 'if-else' statement
38. What is the purpose of the 'volatile' keyword in Java?
- A. To declare a constant variable
- B. To prevent a variable from being modified
- C. To indicate that a variable's value may be changed by multiple threads
- D. To allocate memory
39. What is the purpose of the 'do-while' loop in Java?
- A. To execute a block of code repeatedly
- B. To iterate over elements in an array
- C. To always execute at least once
- D. To exit a loop
40. What is the role of the 'throws' keyword in Java?
- A. To throw an exception
- B. To declare a method that may throw an exception
- C. To catch an exception
- D. To define an interface
41. What is the output of the following code snippet?
int x = 10; if (x > 5) System.out.println("x is greater than 5"); else System.out.println("x is less than or equal to 5");- A. x is greater than 5
- B. x is less than or equal to 5
- C. x is 5
- D. Compilation error
42. What is the purpose of the 'static block' in Java?
- A. To define static variables
- B. To initialize static variables
- C. To execute code only once before the main method
- D. To access instance variables
43. What is the output of the following code snippet?
int[] numbers = {1, 2, 3, 4, 5}; for (int i : numbers) { System.out.print(i + " "); }- A. 1 2 3 4 5
- B. 5 4 3 2 1
- C. 1 3 5
- D. Compilation error
44. What is the purpose of the 'finalize()' method in Java?
- A. To initialize an object
- B. To release system resources before an object is garbage collected
- C. To compare two objects
- D. To create an object
45. Which method is used to obtain the length of an array in Java?
- A. length()
- B. size()
- C. count()
- D. sizeOf()
46. What is the purpose of the 'instanceof' operator in Java?
- A. To check if an object is an instance of a specific class
- B. To convert an object to a different class
- C. To compare two objects
- D. To check if an object is null
47. What is the difference between '==', '.equals()', and '.equalsIgnoreCase()' in Java?
- A. They are used interchangeably
- B. '==' compares object references, '.equals()' compares content, '.equalsIgnoreCase()' compares content ignoring case
- C. '==' is used for integers, '.equals()' for objects, '.equalsIgnoreCase()' for strings
- D. '.equals()' is used for integers, '==' for objects, '.equalsIgnoreCase()' for strings
48. What is the purpose of the 'instanceof' operator in Java?
- A. To check if an object is an instance of a specific class
- B. To convert an object to a different class
- C. To compare two objects
- D. To check if an object is null
49. Which keyword is used to explicitly throw an exception in Java?
- A. raise
- B. throw
- C. throws
- D. exception
50. What is the output of the following code snippet?
String str1 = "Hello"; String str2 = new String("Hello"); System.out.println(str1 == str2);- A. true
- B. false
- C. Compilation error
- D. NullPointerException
51. What is the purpose of the 'try-catch-finally' block in Java?
- A. To terminate the program
- B. To handle exceptions
- C. To define a loop
- D. To create an object
- Follow us for more updates , Habbit2Code
Comments
Post a Comment