Java MCQ questions and answers for freshers | java mcq questions pdf

In this page you get all the latest java mcq questions and answers which will help you in preparing for placements, aptitude, technical interview and also for GATE exams.

01) Method overloading is the process of defining two or more methods within the same class that have same name but _____ parameters.

  1. same
  2. different
  3. none of the above

Correct answer: different

02) Which of the below access specifiers must be used for main() method?

  1. private
  2. public
  3. protected
  4. None of the above

Correct answer: public

03) Which of the below is not an access modifier?

  1. public
  2. private
  3. protected
  4. void

Correct answer: void

04) Arrays in java are implemented as?

  1. object
  2. class
  3. variable
  4. None of the above

Correct answer: object

05) String in java is a _____.

  1. object
  2. class
  3. variable
  4. char array

Correct answer: object

06) ____ is the method which is executed first before execution of any other thing takes place in a program.

  1. main method
  2. private method
  3. finalize method
  4. static method

Correct answer: Static method

07) Which of the below method is given parameter via command line arguments?

  1. recursive() method
  2. main() method
  3. NULL method
  4. None of the above

Correct answer: main() method

08) Which class allows parsing of command line arguments?

  1. Jcommander
  2. args
  3. fcommd
  4. none of the above

Correct answer: Jcommander

09) Which annotations is used to represent command line i/p and assigned to correct data type?

  1. @Parameter
  2. @Input
  3. @variable
  4. None of the above

Correct answer: @Parameter

10) Recursion is a process of defining a method that calls ___ methods _____.

  1. itself, thrice
  2. other, twice
  3. other, repeatedly
  4. none of the above

Correct answer: other methods repeatedly