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