Fundamentals of Java Class 12 MCQ
1. JVM Stands for ___________.
a. Java Virtual Machine
b. Java Verify Machine
c. Java Vector Machine
Show Answer ⟶
d. None of the above
a. Java Virtual Machine
2. Java programs are _____________.
a. Platform Independent
b. Highly Portable
c. Both a) and b)
Show Answer ⟶
d. None of the above
c. Both a) and b)
3. Java support __________.
a. Compiler
b. Interpreter
d. Assembler
Show Answer ⟶
e. None of the above
b. Interpreter
4. Java converts the program in __________.
a. Byte
b. Megabyte
c. Bytecode
Show Answer ⟶
d. None of the above
c. Bytecode
Fundamentals of Java Class 12 MCQ
5. IDE Stands for __________.
a. Integrated Developer Environments
b. Integrated Development Environments
c. Internal Developer Environments
Show Answer ⟶
d. Internal Development Environments
b. Integrated Development Environments
6. Java NetBeans IDE is ________ software.
a. Close source
b. Middle source
c. Open Source
Show Answer ⟶
d. None of the above
c. Open Source
7. How we can write comments in Java programs.
a. Two forward slashes (//)
b. /* and */
c. Both a) and b)
Show Answer ⟶
d. None of the above
c. Both a) and b)
8. In Java a group of related classes is known as _______.
a. Group
b. Package
c. Method
Show Answer ⟶
d. None of the above
b. Package
9. In Java most common pre-built Java output methods are ___________.
a. System.out.println();
b. Public class
c. Public static void main(String[] args)
Show Answer ⟶
d. None of the above
a. System.out.println();
Fundamentals of Java Class 12 MCQ
10. A Variable is a placeholder for data that can change its value during
program execution.
a. Constant
b. Variable
c. Data type
Show Answer ⟶
d. None of the above
b. Variable
11. In Java, How many types of primitive Data Type.
a. 6
b. 7
c. 8
Show Answer ⟶
d. 9
c. 8
12. In Java, Which type of datatype is used to store Integer values.
a. Byte
b. Int
c. Long
Show Answer ⟶
d. All of the above
d. All of the above
13. Int Data Type can store ________ bit of data.
a. 8-bit
b. 16-bit
c. 32-bit
Show Answer ⟶
d. 64-bit
c. 32-bit
14. Float Data Type can store ________ bit of data.
a. 8-bit
b. 16-bit
c. 32-bit
Show Answer ⟶
d. 64-bit
c. 32-bit
Fundamentals of Java Class 12 MCQ
15. Double Data Type can store ________ bit of data.
a. 16-bit
b. 32-bit
c. 64-bit
Show Answer ⟶
d. 8-bit
c. 64-bit
16. Char Datatype can store _________ bit of data.
a. 16-bit
b. 32-bit
c. 64-bit
Show Answer ⟶
d. 8-bit
a. 16-bit
17. Boolean Data Type can store _________ bit of data.
a. 16-bit
b. 32-bit
c. 1-bit
Show Answer ⟶
d. 8-bit
c. 1-bit
18. What are the naming rules we have to follow to declare a variable.
a. Variable names can begin with either an alphabetic character, Underscore or a dollar
sign.
b. Space are not allowed in variable names
c. Reserved words cannot be used as a variable name
Show Answer ⟶
d. All of the above
d. All of the above
19. To store more than one character, we use the _______ data type.
a. Integer
b. Character
c. String
Show Answer ⟶
d. None of the above
c. String
Fundamentals of Java Class 12 MCQ
20. ___________ are special symbols in a programming language and perform
certain specific operations.
a. Operators
b. Variable
c. Datatype
Show Answer ⟶
d. None of the above
a. Operators
21. ++ is known as which operator.
a. Increment Operator
b. Decrements Operator
c. Assignment Operator
Show Answer ⟶
d. Modulus
a. Increment Operator
22. Which of the following belongs to logical operators.
a. &&
b. ||
c. !
Show Answer ⟶
d. All of the above
d. All of the above
23. Which of the following is an example of selection structures.
a. If else statement
b. Switch statement
c. Else if statement
Show Answer ⟶
d. All of the above
d. All of the above
24. The __________ in Java lets us execute a block of code depending upon
whether an expression evaluates to true or false.
a. If statements
b. For statements
c. Array Statements
Show Answer ⟶
d. None of the above
a. If statements
Fundamentals of Java Class 12 MCQ
25. To combine two relational expressions in a program.
a. Logical OR
b. Logical AND
c. Logical NOT
Show Answer ⟶
d. None of the above
b. Logical AND
26. If inside the if is known as _________.
a. Outer If
b. Inner If
c. Nested If
Show Answer ⟶
d. All of the above
c. Nested If
27. The ____________ is used to execute a block of code matching one value out
of many possible values.
a. If statement
b. Switch Statement
c. For Statement
Show Answer ⟶
d. None of the above
b. Switch Statement
28. The ability of a computer to perform the same set of actions again and
again is called looping.
a. Looping
b. Actioning
c. Performing
Show Answer ⟶
d. None of the above
a. Looping
29. What are the different looping statements available in Java?
a. For loop
b. While loop
c. Do-while loop
Show Answer ⟶
d. All of the above
d. All of the above
Fundamentals of Java Class 12 MCQ
30. The ________ statement evaluates the test before executing the body of a
loop.
a. Goto
b. While loop
c. Do-while loop
Show Answer ⟶
d. All of the above
b. While loop
31. The __________ statement evaluates the test after executing the body of a
loop.
a. Goto
b. While loop
c. Do-while loop
Show Answer ⟶
d. All of the above
c. Do-while loop
32. _________ is known as the entry control loop.
a. While loop
b. Do-while loop
c. Goto loop
Show Answer ⟶
d. All of the above
a. While loop
33. __________ is known as the exit control loop.
a. While loop
b. Do-while loop
c. Goto loop
Show Answer ⟶
d. All of the above
b. Do-while loop
34. Which condition required for executing the loop –
a. Initial value
b. Condition
c. Counter
Show Answer ⟶
d. All of the above
d. All of the above
Fundamentals of Java Class 12 MCQ
35. __________ are variables that can hold more than one value, they can hold a
list of values of the same type.
a. Loop
b. Constant
c. Variable
Show Answer ⟶
d. None of the above
c. Variable
36. __________ helps to create a tab between the numbers in the print
statement.
a. \tt
b. \t
c. \tb
Show Answer ⟶
d. \tab
b. \t
37. Array addresses always start from _________.
a. 0
b. 1
c. 2
Show Answer ⟶
d. 3
a. 0
38. OOP Stands for ____________.
a. Object Oriented Programming
b. Outer Oriented Programming
c. Outer Object Programming
Show Answer ⟶
d. Oriented Object Programming
a. Object Oriented Programming
39. Java’s most fundamental features are _________.
a. Class
b. Objects
c. Both a) and b)
Show Answer ⟶
d. None of the above
c. Both a) and b)
Fundamentals of Java Class 12 MCQ
40. Function declared inside the class is known as __________.
a. Member function
b. Inner function
c. Outer function
Show Answer ⟶
d. None of the above
a. Member function
41. The body of class is enclosed within ____________.
a. Small braces
b. Curly braces
c. Big braces
Show Answer ⟶
d. None of the above
b. Curly braces
42. The variable declared outside the class is known as ___________.
a. Local variable
b. Global variable
c. Inner variable
Show Answer ⟶
d. All of the above
b. Global variable
43. The variable declared inside the class is known as __________.
a. Local variable
b. Global variable
c. Inner variable
Show Answer ⟶
d. All of the above
a. Local variable
44. __________ is a data member that is declared but not initialized before using,
and is assigned a default value by the compiler, usually either zero or null.
a. Class
b. Object
c. Constructors
Show Answer ⟶
d. None of the above
c. Constructors
Fundamentals of Java Class 12 MCQ
45. __________ has the same name as the class.
a. Class
b. Object
c. Constructors
Show Answer ⟶
d. None of the above
c. Constructors
46. Data members and method members of an object are accessed using the
_________ operator.
a. Comma (,)
b. Dot (.)
c. Modular (%)
Show Answer ⟶
d. Dollar ($)
b. Dot (.)
47. Data members of a class can be accessed from outside the class by default.
Identify the access modifiers from the below list __________.
a. Private
b. Public
c. Protected
Show Answer ⟶
d. All of the above
d. All of the above
48. Private data members of a class cannot be accessed outside the class
however, you can give controlled access to data members outside the class
through ____________.
a. Getter
b. Setter
c. Both a) and b)
Show Answer ⟶
d. None of the above
c. Both a) and b)
49. To import the class from the package, you have to use ____________ keyword.
a. Insert
b. Import
c. Add
Show Answer ⟶
d. None of the above
b. Import
Fundamentals of Java Class 12 MCQ
50. We can take input from the user using ___________ object.
a. Scanner
b. System.out.println();
c. Both a) and b)
Show Answer ⟶
d. None of the above
a. Scanner
51. _________ function helps to convert string value to the integer value in Java.
a. parseInt();
b. parseDouble()
c. parseString();
Show Answer ⟶
d. None of the above
a. parseInt();
52. To sort the array of integers in ascending order _______ function required.
a. Arrange()
b. Filter()
c. Sort()
Show Answer ⟶
d. None of the above
c. Sort()
53. __________ function helps to convert all of the characters in lower case.
a. toLowerCase()
b. toSmallCase()
c. to BelowCase()
Show Answer ⟶
d. None of the above
a. toLowerCase()
54. __________ function helps to convert all the characters in Upper case.
a. toUpperCase()
b. toCaptialCase()
c. touppercase()
Show Answer ⟶
d. None of the above
a. toUpperCase()
Fundamentals of Java Class 12 MCQ
55. __________ function helps to return a new string after replacing all
occurrences of old string.
a. replace()
b. Change()
c. Convert()
d. None of the above
Show Answer ⟶
a. replace()
56. ________ function helps to return the length of the string.
a. replace()
b. isEmpty()
c. indexOf()
Show Answer ⟶
d. None of the above
a. replace()
57. _______ function helps to return the index of the first occurrence of a given
substring.
a. length()
b. isEmpty()
c. indexOf()
Show Answer ⟶
d. None of the above
c. indexOf()
58. When unexpected errors come in the program it is handled by ___________.
a. Error handling
b. Exception handling
c. Both a) and b)
Show Answer ⟶
d. None of the above
b. Exception handling
Fundamentals of Java Class 12 MCQ
60. Which keywords handle an exception in Java programming.
a. Try
b. Catch
c. Both a) and b)
Show Answer ⟶
d. None of the above
c. Both a) and b)
61. _________ helps to access the network services that are running on the local
computer.
a. Localhost
b. Local Network
c. network
Show Answer ⟶
d. None of the above
a. Localhost
62. What are the different ways to create threads in Java?
a. By extending the Thread class
b. By implementing the Runnable interface
c. Both a) and b)
Show Answer ⟶
d. None of the above
c. Both a) and b)
63. A ______________ is one that can perform multiple tasks concurrently so that
there is optimal utilization of the computer’s resources.
a. Resources program
b. Multithreaded program
c. Class program
Show Answer ⟶
d. None of the above
b. Multithreaded program
64. What are the different types of passing values in Java?
a. Pass by value & not Pass by reference
b. Pass by data & Pass by address
c. Pass by String & Pass by reference
Show Answer ⟶
d. None of the above
a. Pass by value & not Pass by reference
Fundamentals of Java Class 12 MCQ
65. What are the basic idea in exception handling ____________.
a. Denote an exception block
b. Catch the exception
c. Handle the exception
Show Answer ⟶
d. All of the above
d. All of the above
66. ___________ a file format based on the popular ZIP file format and is used for
aggregating many files into one.
a. Java ARchive (JAR)
b. Java Bin (JB)
c. Java Method (JM)
Show Answer ⟶
d. None of the above
a. Java ARchive (JAR)
67. JDBC Stands for ___________.
a. Java Data Connection
b. Java Database Connection
c. Java Database Connectivity
Show Answer ⟶
d. Java Data Connectivity
c. Java Database Connectivity
68. An ___________ is a useful mechanism for effectively identifying/detecting
and correcting logical errors in a program. When developing your Java
programs.
a. Database
b. Assertion
c. Archive
Show Answer ⟶
d. None of the above
b. Assertion