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