Java Online Test MCQs Questions Answers
Java Online Test MCQs Questions Answers
Java Online Test MCQs Questions Answers is the set of MCQs of Java. These MCQs are prepared keeping in view the different exams of past papers. Let’s begin with SET 1.
SET 1 Java MCQs Questions Answers – Important Questions of GAT Subject NTS
1: Computer programs are consisted of code and ________.select the correct option.
A. loops
B. numbers
C. data
D. information
E. All of these
F. Both A and B
2: In access specifiers , opposite of public is_______. select the correct option.
A. semi protected
B. protected
C. local
D. private
E. All of these
F. Both A and B
3: Right syntax of control statement IF is___________-. Which statement is correct.
A. if (condition) statement ;
B. IF (CONDITION) THEN STATEMENT ;
C. if(condition) then statement;
D. if(CONDITION) statement
E. All of these
F. Both A and B
4: Select the correct option according to given statement. Int num ; // declares a variable called_________.
A. integer num
B. num
C. int num
D. num variable
E. All of these
F. Both A and B
5: An essential element of OOP is called __________. select the correct option.
A. securing code
B. coding from real world
C. making libraries
D. abstraction
E. All of these
F. Both A and B
6: System.out.println(num); will display____________.
A. type of variable
B. any number
C. value of variable num
D. name of the variable
E. All of these
F. Both A and B
7: You can string together as many items as you want within a single println(), by using which of the following.
A. plus sign
B. comma sign
C. colon
D. percent sign
E. All of these
F. Both A and B
8: Tha java compiler requires that a source file use filename extension is called _________.
A. .java
B. .javac
C. .javarun
D. .javax
E. All of these
F. Both A and B
9: Width of a byte is. Select anyone.
A. 6
B. 6
C. 4
D. 8
E. All of these
F. Both A and B
10: If (x<y) { x=y ; y=0; } if x is less then y then. Which of the following statement is correct.
A. y will become zero
B. both statements will be neglected
C. both statements will be executed
D. exchange values
E. All of these
F. Both A and B
SET 2 Java MCQs Questions Answers – Important Questions of GRE
11: Char ch1 = 88 ; println(ch1) ; will display. Select the correct option.
A. 89
B. X
C. x
D. 88
E. All of these
F. Both A and B
12: System.out.print(“Good Luck” + ); This statement missed. Which of the following is suitable?
A. single quotes
B. ln in print command
C. variable after +
D. comma
E. All of these
F. Both A and B
13: In System.out.println , System is called ___________.
A. system for main display
B. package
C. computer system
D. client side system to display data
E. All of these
F. Both A and B
14: Acceptable keyword in JAVA is called ____________.
A. none
B. short
C. Short
D. SHORT
E. All of these
F. Both A and B
15: Valid identifier is called _____________. Choose the correct option.
A. high-temp
B. x’
C. not/ok
D. count
E. All of these
F. Both A and B
16: Pi = 3.14 ; is called ___________.
A. short number
B. integer
C. constant
D. floating number
E. All of these
F. Both A and B
20: There are three types of comments in JAVA ; single line , multiple line and the third one is ________________.
A. method comment
B. documentation comment
C. package comment
D. library comment
E. All of these
F. Both A and B
29: System.out.println("Good Luck") . This statement has a ___________.
A. syntax error
B. logical error
C. runtime error
D. compiling error
E. All of these
F. Both A and B
[su_spoiler title="Answer - Click Here:" class="padding: -10px;"]A[/su_spoiler Answer]
30: Num = 100 ; is called __________.
A. num can store integer type value
B. num and 100 are equal
C. num is EXACTLY EQUAL TO 100
D. assigns 100 value to a variable num
E. All of these
F. Both A and B
SET 3 Java MCQs Questions Answers - Important Questions for Jobs Tests
31: Syntax of a multiple line comment is called _____________.
A. //?..//
B. /* ?.. */
C. //
D. a/ ?/a
E. All of these
F. Both A and B
35: Some programs are written around "what is happening",it is called ____________.
A. hirearchel
B. process oriented
C. linear
D. looped
E. All of these
F. Both A and B
37: ==' symbol means called ____________.
A. nothing in Java
B. sign a value
C. operands are same
D. exchange values
E. All of these
F. Both A and B
38: For( int x=0 ; x<10; x++) statement ; will be executed. Select the correct option.
A. 11 times
B. 9 times
C. 10 times
D. 5 times
E. All of these
F. Both A and B
39: All java applications begin with execution by calling is called ______________.
A. compiling unit
B. main()
C. class file
D. runnable unit
E. All of these
F. Both A and B
40: Arrays are collection is called _____________.
A. complex objects
B. simple objects
C. simple data types
D. similar objects
E. All of these
F. Both A and B
SET 4 Java MCQs Questions Answers - Important Questions for Admissions Tests
41: Right syntax for declaring class is called __________
A. examplE
B. example
C. EXAMPLE!
D. Example
E. All of these
F. Both A and B
42: Main instead of main can is called ____________.
A. not execute
B. cause error
C. compile-time error
D. still compile your program
E. All of these
F. Both A and B
43: Private data and methods can only be accessed by code that is a member of a. Select the correct option.
A. outer methods
B. class
C. package
D. subpackage
E. All of these
F. Both A and B
44: An object dog is a child of mammal is called ___________.
A. category
B. package
C. class
D. method
E. All of these
F. Both A and B
45: Main() must be delcared as a ___________.
A. same as other methods
B. public
C. protected
D. private
E. All of these
F. Both A and B
46: For class member's security , access specifier used is called ___________.
A. private
B. public
C. protected
D. same as other members
E. All of these
F. Both A and B
47: Valid identifier is called ___________.
A. _a
B. a4
C. _avg
D. _count
E. All of these
F. Both A and B
48: Y- - ; is called ________. Select the correct option.
A. subtraction statement
B. decrement statement
C. wrong statement
D. normal statement
E. All of these
F. Both A and B
50: An object-oriented program can be characterised as data controlling called ___________. Select the correct option
A. syntax
B. code
C. classes
D. libraries
E. All of these
F. Both A and B