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