SlideShare a Scribd company logo
JAVA INTERVIEW
QUESTIONS
Why is Java called Platform Independent
programming Language?
Java is a platform independent programming language
because of the bytecode. Java compiler converts the
source code into the bytecode which can be run on any
platform where the JVM is available. This byte code is
converted into the machine specific code by the Java
Interpreter.
When is super keyword Used?
1. If we have to call the immediate parent class
constructor we use the super keyword.
2. If we have to call immediate parent class
method, we use super keyword.
3. super keyword is used to refer to the parent
class instance variable.
What is the difference between StringBuffer
and String?
A String is an immutable class whereas StringBuffer
is a mutable class. Immutable means unchangeable.
String object can't change its content when it is
once created but a new object is created.
Mutable means content can be modifiable. we can
change the content of StringBuffer object.
How we create a string in Java?
If we are creating string object using the new keyword,
JVM will store it into the Heap Memory.
We can create a string in java by using two ways:
1. By using the new keyword.
2. By using String literal.
If we are creating string object using the String literal,
JVM first checks its availability into the string constant
pool. If it is already present in the pool, JVM creates just
a reference to that string. If not present in the pool JVM
will create a string in the string constant pool.
How we create a thread in Java?
We can create Thread in Java by using two ways:
By Extending a Thread class.
By implementing Runnable interface.
what are the major differences between Java
and C++?
1. Java is a platform independent language whereas C++
is a platform dependent programming language.
2. Java has removed many complex features like
Explicit pointers, Operator overloading, Multiple-
inheritance, Structure, Union etc. Whereas C++
supports all theses features.
www.java2blog.com
Contact Us

More Related Content

DOCX
What are the different java interview questions you need to know?
PDF
What are the different java interview questions you need to know?
PPTX
Java byte code presentation
PPTX
Java architecture
PPT
introduction to java
PPTX
2. hello java
PDF
Top 10 Java Interview Questions and Answers 2014
What are the different java interview questions you need to know?
What are the different java interview questions you need to know?
Java byte code presentation
Java architecture
introduction to java
2. hello java
Top 10 Java Interview Questions and Answers 2014

What's hot (20)

PDF
Java interview questions and answers
PDF
Introduction to java
PPTX
Java virtual machine
PPT
Java begin so we win
 
PPT
Java introduction
PDF
Python's dynamic nature (rough slides, November 2004)
PPT
CS Lesson: Introduction to the Java virtual Machine
PPTX
Features of JAVA Programming Language.
PDF
Introduction to basics of java
PDF
JVM Bytecodes
PPT
Java basics
PPTX
Introduction to java
PPTX
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
PDF
Defining classes
PDF
Core java course syllabus
PPTX
Java interview questions and answers
Introduction to java
Java virtual machine
Java begin so we win
 
Java introduction
Python's dynamic nature (rough slides, November 2004)
CS Lesson: Introduction to the Java virtual Machine
Features of JAVA Programming Language.
Introduction to basics of java
JVM Bytecodes
Java basics
Introduction to java
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Defining classes
Core java course syllabus
Ad

Similar to Java interview questions (20)

DOCX
Java interview questions and answers for cognizant By Data Council Pune
PDF
java basic .pdf
PPTX
Java lab lecture 1
PDF
Volatile keyword
PDF
Java Faqs useful for freshers and experienced
PDF
1669617800196.pdf
PDF
Top 371 java fa qs useful for freshers and experienced
PPTX
Chapter One Basics ofJava Programmming.pptx
DOCX
100 Java questions FOR LOGIC BUILDING SOFTWARE.docx
DOC
Java questions and answers jan bask.net
PPTX
JAVA AND OOPS CONCEPTS.pptx helpful for engineering
PPTX
Concepts of core java
PPTX
Interview-QA.pptx
PDF
java notes.pdf
DOCX
PPS
Introduction to Java
PPTX
Object-Oriented Programming with Java UNIT 1
PDF
20 most important java programming interview questions
PDF
Java unit 1
PDF
Java programming material for beginners by Nithin, VVCE, Mysuru
Java interview questions and answers for cognizant By Data Council Pune
java basic .pdf
Java lab lecture 1
Volatile keyword
Java Faqs useful for freshers and experienced
1669617800196.pdf
Top 371 java fa qs useful for freshers and experienced
Chapter One Basics ofJava Programmming.pptx
100 Java questions FOR LOGIC BUILDING SOFTWARE.docx
Java questions and answers jan bask.net
JAVA AND OOPS CONCEPTS.pptx helpful for engineering
Concepts of core java
Interview-QA.pptx
java notes.pdf
Introduction to Java
Object-Oriented Programming with Java UNIT 1
20 most important java programming interview questions
Java unit 1
Java programming material for beginners by Nithin, VVCE, Mysuru
Ad

More from Java2Blog (7)

PDF
Core Java Tutorial
PDF
Java String
PDF
Exception Handling in Java
PDF
Polymorphism in Java
PDF
Spring Tutorial for Beginners
PDF
Web Service Tutorial
PDF
How to Learn Java Programming
Core Java Tutorial
Java String
Exception Handling in Java
Polymorphism in Java
Spring Tutorial for Beginners
Web Service Tutorial
How to Learn Java Programming

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Lesson notes of climatology university.
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
master seminar digital applications in india
PPTX
Cell Types and Its function , kingdom of life
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
TR - Agricultural Crops Production NC III.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Anesthesia in Laparoscopic Surgery in India
01-Introduction-to-Information-Management.pdf
Renaissance Architecture: A Journey from Faith to Humanism
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
O7-L3 Supply Chain Operations - ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
Lesson notes of climatology university.
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
master seminar digital applications in india
Cell Types and Its function , kingdom of life
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
TR - Agricultural Crops Production NC III.pdf

Java interview questions

  • 2. Why is Java called Platform Independent programming Language? Java is a platform independent programming language because of the bytecode. Java compiler converts the source code into the bytecode which can be run on any platform where the JVM is available. This byte code is converted into the machine specific code by the Java Interpreter.
  • 3. When is super keyword Used? 1. If we have to call the immediate parent class constructor we use the super keyword. 2. If we have to call immediate parent class method, we use super keyword. 3. super keyword is used to refer to the parent class instance variable.
  • 4. What is the difference between StringBuffer and String? A String is an immutable class whereas StringBuffer is a mutable class. Immutable means unchangeable. String object can't change its content when it is once created but a new object is created. Mutable means content can be modifiable. we can change the content of StringBuffer object.
  • 5. How we create a string in Java? If we are creating string object using the new keyword, JVM will store it into the Heap Memory. We can create a string in java by using two ways: 1. By using the new keyword.
  • 6. 2. By using String literal. If we are creating string object using the String literal, JVM first checks its availability into the string constant pool. If it is already present in the pool, JVM creates just a reference to that string. If not present in the pool JVM will create a string in the string constant pool.
  • 7. How we create a thread in Java? We can create Thread in Java by using two ways: By Extending a Thread class. By implementing Runnable interface.
  • 8. what are the major differences between Java and C++? 1. Java is a platform independent language whereas C++ is a platform dependent programming language. 2. Java has removed many complex features like Explicit pointers, Operator overloading, Multiple- inheritance, Structure, Union etc. Whereas C++ supports all theses features.