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