Skip to main content

Page I - Java Interview Questions With Answers.

1. What Do You Know About Java?

Answer: Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

2. What Are The Supported Platforms By Java Programming Language?

Answer: Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of
UNIX/Linux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS, etc.

3. List Any Five Features Of Java?

Answer: Some features include:
  • Object Oriented.
  • Platform Independent.
  • Robust.
  • Secured & Dynamic.
  • Multi-threaded.

4. Why Is Java Architectural Neutral?

Answer: It’s compiler generates an architecture-neutral object file format, which makes the compiled code to be executable on many processors, with the presence of Java runtime system.

5. How Java Enabled High Performance?

Answer: Java uses Just-In-Time compiler to enable high performance. Just-In-Time compiler is a program that turns Java bytecode, which is a program that contains instructions that must be interpreted into instructions that can be sent directly to the processor.

6. Why Java Is Considered Dynamic?

Answer: It is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run time.

7. What Is Java Virtual Machine & How It Is Considered In Context Of Java’s Platform Independent Feature?

Answer: When Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is distributed over the web and interpreted by virtual
Machine JVM on whichever platform it is being run.

8. List Two Java IDE’s?

Answer: Netbeans, Eclipse, etc.

9. List Some Java Keywords Unlike C, C + + Keywords?

Answer: Some Java keywords are import, super, finally, etc.

10.What Do You Mean By Object?

Answer: Object is a runtime entity and it’s state is stored in fields and behavior is shown via methods. Methods operate on an object's internal state and serve as the primary mechanism for object to object communication.

11. Define Class?

Answer: A class is a blueprint from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.

12. What Kind Of Variables A Class Can Consist Of?

Answer: A class consist of Local variable, instance variables and class variables.

13. What Is A Local Variable?

Answer: Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and it will be destroyed when the method has completed.

14. What Is A Instance Variable?

Answer: Instance variables are variables within a class but outside any method. These variables are
instantiated when the class is loaded.

15. What Is A Class Variable?

Answer: These are variables declared with in a class, outside any method, with the static keyword.

16. What Is Singleton Class?

Answer: Singleton class control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes.

17. What Do You Mean By Constructor?

Answer: Constructor gets invoked when a new object is created. Every class has a constructor. If we do not explicitly write a constructor for a class the java compiler builds a default constructor for that class.

18. List The Three Steps For Creating An Object For A Class?

Answer: An Object is first declared, then instantiated and then it is initialized.

19. What Is The Default Value Of Byte Datatype In Java?

Answer: Default value of byte data type is 0.

20. What Is The Default Value Of Float & Double Datatype In Java?

Answer: Default value of float and double data type in different as compared to C/C++. For float it's 0.0f and for double it’s 0.0d

21. When A Byte Datatype Is Used?

Answer: This datatype is used to save space in large arrays, mainly in place of integers, since a byte is four times smaller than an int.

22. What Is A Static Variable?

Answer: Class variables also known as static variables are declared with the static keyword in a class, but outside a method, constructor or a block.

23. What Do You Mean By Access Modifier?

Answer: Java provides access modifiers to set access levels for classes, variables, methods and constructors. A member has package or default accessibility when no accessibility modifier is specified.

24. What Is Protected Access Modifier?

Answer: Variables, methods and constructors which are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members' class.

25. What Do You Mean By Synchronized Non Access Modifier?

Answer: Java provides these modifiers for providing functionalities other than Access Modifiers, synchronized used to indicate that a method can be accessed by only one thread at a time.


Check Out Other Questions As Well: -


26. According To Java Operator Precedence, Which Operator Is Considered To Be With Highest Precedence?
27. Variables Used In A Switch Statement Can Be Used With Which Data Types?
28. When parseInt Method Can Be Used?
29. Why Is String Class Considered Immutable?
30. Why Is StringBuffer Called Mutable?

31. What Is The Difference Between StringBuffer & StringBuilder Class?
32. Which Package Is Used For Pattern Matching With Regular Expressions?
33. java.util.regex Consists Of Which Classes?
34. What Is Finalize Method?
35. What Is An Exception?

36. What Do You Mean By Checked Exceptions?
37. Explain Runtime Exceptions?
38. Which Are The Two Subclasses Under Exception Class?
39. When throws Keyword Is Used?
40. When throw Keyword Is Used?

41. How finally Keyword Is Used Under Exception Handling?
42. What Things Should Be Kept In Mind While Creating Your Own Exceptions In Java?
43. Define Inheritance?
44. When super Keyword Is Used?
45. What Is Polymorphism?

46. What Is Abstraction?
47. What Is Abstract Class?
48. When Abstract Methods Are Used?
49. What Is Encapsulation?
50. What Is The Primary Benefit Of Encapsulation?

...Return To Java FAQ's Section


Comments

Popular posts from this blog

Tell Me Something About Yourself - Interview Answers.

Try to introduce some of your most important employment-oriented skills as well as your education and accomplishments to the interviewer. Answer to this question is very important because it positions you for the rest of the interview . That's why this statement is often called the "Positioning Statement". One should take the opportunity to show his/her communication skills by speaking clearly and concisely in an organized manner. Since there is no right or wrong answer for this question hence it is important to appear friendly. YOUR ANSWERS CAN BE: 1) I am a person with strong interpersonal skills and have the ability to get along well with people . I enjoy challenges and looking for creative solutions to problems. 2) Besides the details given in my resume, I believe in character values, vision and action. I am quick in learning from mistakes. I am confident that the various tests that you have conducted will corroborate my competencies apti...

HR Interview Questions With Simple Answers - Top 30.

Here are some very important HR questions which are often asked during Interviews and I believe these answers can really help you to get through....... Click on them to view the answer: 1) Tell Me Something About Yourself ? 2) What Are Your Strengths? 3) What Are Your Weaknesses? 4) How Do You Handle Pressure / Can You Work Well Under Pressure? 5) What Are Your Short Term Goals? 6) What Are Your Long Term Goals? 7) Where Do You See After 5 Years? 8) Why Should We Hire You? 9) What Is Your Salary Expectation? 10) Why Do You Want To Leave Your Current Job? 11) Do You Prefer To Work Alone Or As A Team Player? 12) What Made You Choose Your Major / Stream? 13) Why Didn’t You Pursue A Career In Your Major / Stream? 14) Why Do You Want To Work For Us? 15) Are You Willing To Travel? 16) Are You Willing To Take Risks? 17) What Do You Know About This Company? 18) What Do You Seek From A Job? 19) How Do You Evaluate Success? 20) Dur...

Sample Cover Letter / Job Application.

To The General Manager (HR) [ Name and Designation (Bold Words)] Infosys Limited Delhi – 110001 Uttam Agrawal Gandhi Chowk, Bhartee Street [ Name Bhawanipatna, Kalahandi Contact Address Orissa – 766001 Telephone No.] Ph. no - +91-9438170446 [Sub: Application for the position of ___________ in your esteemed organization.] Respected Sir, (Always use ‘Respected’) With reference to your advertisement dated 14th may’ 08 in The Times of India for the position of ___________ . I would like to place myself as a strong contender before you. OR This has reference to your advertisement dated 14th may’ 08 in The Times of India for the position of ____________. In the said connection I take this opportunity to apply for the said position as a strong contender. /*This is the Introduction i.e the first paragraph of your application/* ( Now the Second Paragraph is the Self Introduction) Try to start the second paragraph with the below mentioned lines: - I have the p...