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