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

Answer - Click Here:
C

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

Answer - Click Here:
D

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

Answer - Click Here:
A

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
Answer - Click Here:
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

Answer - Click Here:
D

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
Answer - Click Here:
C

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
Answer - Click Here:
A

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
Answer - Click Here:
A

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
Answer - Click Here:
D

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

Answer - Click Here:
C

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

Answer - Click Here:
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
Answer - Click Here:
C

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
Answer - Click Here:
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
Answer - Click Here:
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

Answer - Click Here:
D

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
Answer - Click Here:
D[/su_spoiler Answer
17: X = X * 3; will __________. Which of the following is a correct statement.
A. give an error
B. create a new variable and set value
C. change the value of X
D. calculate the power of x by 3
E. All of these
F. Both A and B
Answer - Click Here:
C[/su_spoiler Answer

18: When java source code is compiled, a file named after class is called _____________.
A. no extension
B. .class extension
C. .java extension
D. .javac extention
E. All of these
F. Both A and B
Answer - Click Here:
B[/su_spoiler Answer

19: Identifiers are used for ___________.
A. identifying return type
B. naming the method only
C. class, methods, variable names
D. identifying type
E. All of these
F. Both A and B
Answer - Click Here:
C

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
Answer - Click Here:
B[/su_spoiler Answer]
21: In Java syntax ; comma means IS CALLED ________.
A. separate consecutive identifiers in a variable declaration
B. end of the statement
C. terminate the statement
D. start the next line of code
E. All of these
F. Both A and B
Answer - Click Here:
A[/su_spoiler Answer]

22: In java source file is officially called_____________. Which of the following is the correct option?
A. compilation uni
B. interpreter
C. complition file
D. runnable unit
E. All of these
F. Both A and B
Answer - Click Here:
A[/su_spoiler Answer

23: Width of a long data type is called ____________.
A. 86
B. 32
C. 64
D. 128
E. All of these
F. Both A and B
Answer - Click Here:
C[/su_spoiler Answer]

24: By use of inheritance, an object needs only define those quantities that make it is called __________.
A. like parent
B. unique
C. same
D. extended
E. All of these
F. Both A and B
Answer - Click Here:
B[/su_spoiler Answer]

25: Public variable can be called from a _____________.
A. somewhere only
B. outside the block
C. just outside the method
D. out of the loop
E. All of these
F. Both A and B
Answer - Click Here:
B[/su_spoiler Answer

26: System.out.println("This is a num: " num); this statement has missed. Select the correct option.
A. variable type
B. comma sign
C. plus operator
D.: sign
E. All of these
F. Both A and B
Answer - Click Here:
C[/su_spoiler Answer]

27: In Java syntax; semicolon means. Select the correct option.
A. separate consecutive identifiers
B. end of a statement
C. terminate the statement
D. start the next line of code
E. All of these
F. Both A and B
Answer - Click Here:
C[/su_spoiler Answer]

28: Each variable in a class may be marked is called ________.
A. public
B. unique
C. protected
D. complex
E. All of these
F. Both A and B
Answer - Click Here:
A

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

Answer - Click Here:
D

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

Answer - Click Here:
B[/su_spoiler Answer]
32: Encapsulation is a mechanism that binds together code and data it is called ______________.
A. data
B. shows
C. manipulates
D. embeds
E. All of these
F. Both A and B
Answer - Click Here:
C[/su_spoiler Answer]

33: Int x, y.Select the correct option.
A. will create two different variables
B. create error
C. both variable have index in sequence
D. will create confusion
E. All of these
F. Both A and B
Answer - Click Here:
B[/su_spoiler Answer]

34: Class Example { // here name of class Example is called ________.
A. access specifier
B. definition
C. identity
D. indentifier
E. All of these
F. Both A and B
Answer - Click Here:
D

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
Answer - Click Here:
B[/su_spoiler Answer]
36: For(initialization ; condition ; increment) statement ; is called ___________.
A. data type declaration
B. wrong syntax
C. not containing EXPRESSION
D. no second condition
E. All of these
F. Both A and B
[su_spoiler title="Answer - Click Here:" class="padding: -10px;"]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
Answer - Click Here:
C

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
Answer - Click Here:
C

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

Answer - Click Here:
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
Answer - Click Here:
D

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

Answer - Click Here:
D

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
Answer - Click Here:
D

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
Answer - Click Here:
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
Answer - Click Here:
C

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
Answer - Click Here:
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
Answer - Click Here:
A

47: Valid identifier is called ___________.
A. _a
B. a4
C. _avg
D. _count
E. All of these
F. Both A and B
Answer - Click Here:
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
Answer - Click Here:
B[/su_spoiler
49: Java language is called _________.
A. web-based
B. strong
C. not case-sensitive
D. case sensitive
E. All of these
F. Both A and B
Answer - Click Here:
D

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
Answer - Click Here:
B

Computer Science Repeated MCQs Book Download

Prof. Fazal Rehman Shamil
Latest posts by Prof. Fazal Rehman Shamil (see all)

    Buy advertisement space on T4Tutorials

    For more details email [email protected]