MCQ 1 What is the error in the following class definitions?

abstract class XY { abstract sum(int x, int y){ } }

Correct Answer Choice C Method is not defined properly
See Answer

MCQ 2 What are the part in executing a Java program and their purposes?

Correct Answer Choice A Java Compiler
See Answer

MCQ 3 State true of false.

  • i) Public can only be assigned to class
  • ii) Protected protects a statement
  • iii) Protected method is never accessible outside the package
  • iv) Friendly variable may be accessible outside class
  • <

    Correct Answer Choice C i-false, ii-true, iii-false, iv-false
    See Answer

MCQ 4 In java a ___________ is a sequence of characters.

Correct Answer Choice B arrayChar
See Answer


MCQ 5 Java programs perform I/O through _______________.

Correct Answer Choice C streams
See Answer

MCQ 6 Which of the following methods belong to the string class?

Correct Answer Choice D All of them
See Answer

MCQ 7 If m and n are int type variables, what will be the result of the expression m%n when m=5 and n=2 ?

Correct Answer Choice B 1
See Answer

MCQ 8 State true of false.

  • i) AWT is an extended version of swing
  • ii) Paint() of Applet class cannot be overridden
  • <

    Correct Answer Choice A i − False, ii − False
    See Answer


MCQ 9 Using which keyword we can access value of the instance variables and class variables of that class inside the method of that class itself.

Correct Answer Choice C this
See Answer

MCQ 10 If a variable is declared final, it must include _____________value.

Correct Answer Choice C initial
See Answer

MCQ 11 Methods can be overloaded with a difference only in the type of the return value.

Correct Answer Choice B 0
See Answer

MCQ 12 The keywords reserved but used in the initial version of Java are

Correct Answer Choice A union
See Answer


MCQ 13 Method overriding is combination of _____________ and _______________?

Correct Answer Choice C both
See Answer

MCQ 14 Which component is used to compile, debug and execute java program?

Correct Answer Choice B JDK
See Answer

MCQ 15 Native protocol pure Java converts ________________ into the ______________ used by DBMSs directly.

Correct Answer Choice A JDBC calls, network protocol
See Answer

MCQ 16 Which is the root class of all AWT events

Correct Answer Choice B java.awt.AWTEvent
See Answer


MCQ 17 What will be the result of compiling following code.

public class MyClass{
public static void main(String args[]){
System.out.println("In first main()”); } public static void main(char args[]){ System.out.println (‘a’);}}

Correct Answer Choice C Code will compile correctly and will print “In first main()” (without quotes) when it is run
See Answer

MCQ 18 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?

Correct Answer Choice A Number is negative
See Answer

MCQ 19 A _____________ class may not have any abstract method.

Correct Answer Choice C final
See Answer

MCQ 20 A ______________ object cannot be modified after it is created.

Correct Answer Choice C string
See Answer


MCQ 21 Every method of a ______________ is implicitly final.

Correct Answer Choice C final class
See Answer

MCQ 22 A _____________ is a small unit of process.

Correct Answer Choice B thread
See Answer

MCQ 23 Which method Drops all changes made since the previous commit/rollback?

Correct Answer Choice A public void rollback()
See Answer

MCQ 24 Which one of the following is not a wrap class?

Correct Answer Choice A Random
See Answer


MCQ 25 The java visibility modifier is

Correct Answer Choice A Public
See Answer

NTSE, NEET, AIEEE, Olympiad & Other Competive Exams Preparation

Publish Your Article / Write for Us

Article Writing Guide/Help

Trending Questions


Advantages Of NCERT, CBSE & State Boards Solutions For All Subjects

  • All the NCERT Solutions have been prepared by academic experts having 10+ years of teaching experience.
  • They have prepared all the solutions in simple and easy language, so that each and every student can understand the concepts easily.
  • All the solutions have been explained step to step wise in details with better explainations.
  • Students can also use these question and answers for your assignments and in homework help.
  • All the solutions have been explained in detail and the answers have been compiled in a step-wise manner.
  • All the question and asnwers are commonly prepared according to the Latest Syllabus of Board Education and Guidelines.
  • Students can know about the various types of questions asked in the exams with the help of these solutions.

Top Course Categories