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