MCQ on Java Programming With Answers set-11
1. If m and n are int type variables, what will be the result of the expression m%n when m=-14 and n=-3? A) 4 B) 2 C) -2 D) -4 2. Consider the following code if(number>=0) if(number>0) system.out.println("Number is positive"); else system.out.println("Number is negative"); What will be the output if number is equal to 0? A) Number is negative B) Number is positive C) Both A and B D) None of the above 3. Consider the following code: char c='a'; switch (c) { case 'a'; system.out.println("A"); case 'b'; system.out.println("B"); default; system.out.println("C"); } For this code, which of the following statement is true? A) Output will be A B) Output will be A followed by B C) Output will be A, followed by B, and then followed by C D) Code is illegal and therefore will not compile 4. Consider the following class definition. class Student extends String { } What happens wh...