Java 60 MCQS Question paper Online Test Series 5251 October 5, 2025 0% 13 Java 60 MCQS Question paper Online Test Series 5251 Java MCQ question Paper Basic To Advanced Select BatchMorningEvening 1 / 60 Converting one data type into another is called: Promotion Conversion Typecasting Evaluation 2 / 60 Increment operator is: inc ++ + += 3 / 60 Which declares an integer variable correctly? integer num; var int; num int; int num; 4 / 60 Java is a ______ language. Compiled None Both Interpreted 5 / 60 Infinite loop example: for(;;) while(true) 6 / 60 Boolean type holds: true or false 1 or 0 Yes or No ‘T’ or ‘F’ 7 / 60 Comments are used for: Documentation Execution Debugging only Errors 8 / 60 Which is the assignment operator? = =^ == := 9 / 60 for loop repeats until: Condition is false Condition is true 10 / 60 switch works with: int, char, String boolean only float double 11 / 60 Nested if means: Multiple ifs inside another if Only one if 12 / 60 Which is not a primitive type? String float int char 13 / 60 The modulus operator is: % / * # 14 / 60 Identifiers in Java are ______. Non-sensitive Case-sensitive Numeric Case-insensitive 15 / 60 Array index starts from: 1 0 3 2 16 / 60 Math.abs(-8) returns: 0 -8 Error 8 17 / 60 Output of System.out.println(5+5+”Java”); 55Java Java10 10Java Error 18 / 60 Variables store ______. Keywords Data values Operators Classes 19 / 60 To find length of a String: size(str) str.count() str.size() str.length() 20 / 60 Which is widening conversion? int → double long → short double → int float → byte 21 / 60 Math.sqrt(25) returns: 5 6 Error 4 22 / 60 Strings are ______ in Java. Mutable Immutable 23 / 60 Syntax of if statement: if:condition if(condition){ } None if{condition}( ) 24 / 60 Which method prints a line and moves to the next line? output() write() println() print() 25 / 60 default case in switch is: Mandatory Optional 26 / 60 Which loop executes fixed number of times? while All of the above for do-while 27 / 60 What executes when if condition is false? else block if block 28 / 60 Who is known as the father of Java? Bjarne Stroustrup Guido van Rossum James Gosling Dennis Ritchie 29 / 60 The extension of Java source files is ______. .jar .class .jav .java 30 / 60 Type of Margin in notepad ? 4 8 7 9 31 / 60 Static variables are shared by ______. One object only None All objects One method 32 / 60 Default value of an int variable is: undefined null 1 0 33 / 60 Logical AND is: || && & | 34 / 60 Which keyword defines a class? Class define class object 35 / 60 Which requires explicit cast? Widening Narrowing 36 / 60 double x = 9.8; int y = (int)x; Valid Invalid 37 / 60 To compare two strings: match() compare() equals() == 38 / 60 To get array length: length(arr) arr.length Alm(544) arr.size() 39 / 60 The entry point of any Java program is the ______ method. init() main() run() start() 40 / 60 Which package is required for Scanner? java.lang.* java.io.* java.scanner.* java.util.* 41 / 60 (10 > 5) && (2 < 4) returns: false false/true true/false true 42 / 60 Java statements end with a ______. Semicolon Period Comma Colon 43 / 60 Single-line comments use: // <!– –> # /* */ 44 / 60 Which of these is correct syntax? println("Hi"); echo("Hi"); System.out.println("Hi"); system.out.println("Hi"); 45 / 60 System.out.println(“A”+”B”); prints: A B AB Error A+B 46 / 60 Correct declaration: new array[3]; int arr[] = {1,2,3}; array arr[] = new int; arr int[] = {1,2,3}; 47 / 60 Java was developed by ______. Apple Sun Microsystems Oracle Microsoft 48 / 60 Java is ______ typed. Loosely Statically Dynamically Weakly 49 / 60 What does System.out.print() do? Reads input Prints with newline Stops program Prints without newline 50 / 60 !(5 == 5) results in: false true 51 / 60 Size of double type is: 16 bytes 2 bytes 4 bytes 8 bytes 52 / 60 Default value of boolean is: true null false 0 53 / 60 Syntax of for loop: for(condition; init; update) for(init; update; condition) All Of the above for(init; condition; update) 54 / 60 Which performs multiplication? × x mul * 55 / 60 Boolean can store: true/false T/F 1/0 Yes/No 56 / 60 String class belongs to package: java.string java.lang java.io java.util 57 / 60 Multi-line comments start with: # /* // /** 58 / 60 Every case label must end with: ; exit; stop; break; 59 / 60 Random number function: rand() Math.random() Math.rand() random.Math() 60 / 60 Math.pow(2,4) equals: 4 8 16 6 Your score is 0% Restart Online Test