Latest Qualification Jobs

Check Your Email To Activate the Confirmation Link


Java Programming Questions And Answers (Freshers & Experienced) Online PDF

50000 Jobs For (12th/Graduate) Freshers, Salary 60k – Apply Now

Java Programming Questions And Answers

Candidates who are going to appear in any exam or interview for Java Programming Language can prepare from Java Programming Questions and Answers that are available on this page. These questions are for both Freshers & Experienced applicants. All questions are chosen by experts of you can easily prepare from these questions and can download it in pdf form via online mode.

Java Programming Questions And Answers

1. Which four options describe the correct default values for array elements of the types indicated?
  1. int -> 0

  2. String -> "null"

  3. Dog -> null

  4. char -> '\u0000'

  5. float -> 0.0f

  6. boolean -> true

2. Which one of these lists contains only Java programming language keywords?

3. Which will legally declare, construct, and initialize an array?

4. Which is a reserved word in the Java programming language?

5. Which is a valid keyword in java?

6. You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

7. Which three form part of correct array declarations?
  1. public int a [ ]

  2. static int [ ] a

  3. public [ ] int a

  4. private int a [3]

  5. private int [3] a [ ]

  6. public final int [ ] a

8. public class Test { }
What is the prototype of the default constructor?

9. What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?

10. Which of the following is/are legal method declarations?
1. protected abstract void m1();
2. static final void m1(){}
3. synchronized public final void m1() {}
4. private native void m1();

11. Which cause a compiler error?

12. Which three are valid method signatures in an interface?
1. private int getArea();
2. public float getVol(float x);
3. public void main(String [] args);
4. public static void main(String [] args);
5. boolean setFlag(Boolean [] test);

13. What is the value of "d" after this line of code has been executed?
double d = Math.round ( 2.5 + Math.random() );

14. Which of the following would compile without error?

15. Which of the following are valid calls to Math.max?
1. Math.max(1,4)
2. Math.max(2.3, 5)
3. Math.max(1, 3, 5, 7)
4. Math.max(-1.5, -2.8f)

16. Which one creates an instance of an array?

17. Which two of the following are legal declarations for nonnested classes and interfaces?
1. final abstract class Test {}
2. public static interface Test {}
3. final public class Test {}
4. protected abstract class Test {}
5. protected interface Test {}
6. abstract public class Test {}

18. Which of the following class level (nonlocal) variable declarations will not compile?

19. Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?

20. Which is a valid declaration within an interface?

Something That You Should Put An Eye On

How To Prepare ReasoningQuantitative Aptitude Online Quiz
Online QuizCurrent Affairs
Memory Improvement TechniquesExam Tips For Competitive Exams
How To Prepare For Entrance Exams?Reasoning Online Quiz

Filed in: online quiz

1,00,000 Freshers Jobs In 25,000 Top Companies - Apply Now


Leave a Reply

Submit Comment