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