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