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