SlideShare a Scribd company logo
1 of 12
Java Interview Questions
(Top 100+ Questions and Answers on
Java)
Q.1: What is Java?
Java is a high-level, object-oriented, multithreaded, portable,
and platform-independent programming language. It was
originally designed by James Gosling at Sun Microsystems in June
1991. In 1995, it was released as a core component of Sun
Microsystems.
Later, Sun Microsystems was acquired by Oracle and hence Java
was henceforth developed by Oracle. Currently, Java is one of
the most popular programming languages in the world. It is also
considered as the platform because it has its own JRE and API.
Q.2: What are the main features of
Java?
• Simple
• Object-oriented
• Distributed
• Robust
• Secure
• System Independent
• Portable
• Multithreaded
Q.3: Why pointers are eliminated from
Java?
Pointers are eliminated from Java because:
• Pointers lead to confusion for a program.
• Pointers may crash a program easily. For example, if two pointers
are added, the program crashes immediately. The same thing can
also happen when we forget to free the memory allotted to a
variable and reallot it to another variable.
• Pointers break security. By using pointers, harmful programs such
as viruses and other hacking programs can be developed.
Q.4: What is the class?
There may be some scenarios where some objects
may have similar properties and functions. Such
objects belong to the same category which is
known as a 'class'. For example, Jacob, James,
Smith, etc. belong to a person class. They have the
same properties and actions.
Q.5: Define an object in Java. How an
object is created in Java?
An object denotes an instance of a class. It is a real-
world entity that contains state and behavior. An
object basically consists of the following three
characteristics:
• State
• Behavior
• Identity
Q.6: What is the difference between an
executable file and a class file?
An executable file (.exe) contains machine
language instructions for the microprocessor and
is system dependent. Besides, the class file
contains byte code instructions for the JVM and is
system independent.
Q.7: What is the BYTE code?
The BYTE code is an intermediate-level code that is
interpreted by the JVM. It is not directly executable on
the machine. A BYTE code is a mediator code between
Java program and machine code of operating system (OS)
and is available in ‘.class’ file. A ‘.class’ file is generated
when the Java program or application gets compiled.
BYTE code is the same for any OS but machine code
differs on each OS.
Q.8: What is JVM?
The JVM (Java Virtual Machine) is an abstract
machine designed to be implemented on the top
of existing processors. It hides the underlying
operating system (OS) from Java applications. It is
actually the heart of the entire Java program
execution process.
Q.9: What is JRE?
JRE stands for the 'Java Runtime Environment'. It
is a platform consisting of Java virtual machines,
Java libraries, and all other components required
to run Java applications and applets.
Q.10: What is the Java compiler?
A Java compiler is a program that converts Java
source code to Java byte code.
A basic Java compiler is already included in JDK
(Java Development Kit). The Java compiler is
known as 'javac'.
Read More at:
www.tutorialsmate.com

More Related Content

What's hot

What's hot (20)

Java
JavaJava
Java
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVA
 
JAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKASJAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKAS
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Presentation5
Presentation5Presentation5
Presentation5
 
Advantages of java
Advantages of javaAdvantages of java
Advantages of java
 
concept of core java
concept of core java concept of core java
concept of core java
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Java. converted (2)
Java. converted (2)Java. converted (2)
Java. converted (2)
 
Features of java 02
Features of java 02Features of java 02
Features of java 02
 
core java
core javacore java
core java
 
Java presentation
Java presentation Java presentation
Java presentation
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Java and internet fundamentals.
Java and internet fundamentals.Java and internet fundamentals.
Java and internet fundamentals.
 
Core java
Core javaCore java
Core java
 
Important features of java
Important features of javaImportant features of java
Important features of java
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
 
Intro to Java
Intro to JavaIntro to Java
Intro to Java
 

Similar to 100+ Core java interview questions and Answers

Top 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfTop 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfUmesh Kumar
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxSuganthiDPSGRKCW
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruJava programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruNithin Kumar,VVCE, Mysuru
 
Java Introduction | PDF
Java Introduction |  PDFJava Introduction |  PDF
Java Introduction | PDFGeekster
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf10322210023
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to JavaDevaKumari Vijay
 
Lecture - 1 introduction to java
Lecture - 1 introduction to javaLecture - 1 introduction to java
Lecture - 1 introduction to javamanish kumar
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVAKUNAL GADHIA
 
Java and its features
Java and its featuresJava and its features
Java and its featuresPydi Nikhil
 
0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdfDeepakChaudhriAmbali
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxMurugesh33
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxMurugesh33
 

Similar to 100+ Core java interview questions and Answers (20)

Top 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfTop 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdf
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruJava programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, Mysuru
 
Java Introduction | PDF
Java Introduction |  PDFJava Introduction |  PDF
Java Introduction | PDF
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
 
Java-Unit-I.ppt
Java-Unit-I.pptJava-Unit-I.ppt
Java-Unit-I.ppt
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
 
java slides
java slidesjava slides
java slides
 
Lecture - 1 introduction to java
Lecture - 1 introduction to javaLecture - 1 introduction to java
Lecture - 1 introduction to java
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Java and its features
Java and its featuresJava and its features
Java and its features
 
0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf
 
Chapter 1 (1).pptx
Chapter 1 (1).pptxChapter 1 (1).pptx
Chapter 1 (1).pptx
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
 
Getting Started with JAVA
Getting Started with JAVAGetting Started with JAVA
Getting Started with JAVA
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

100+ Core java interview questions and Answers

  • 1. Java Interview Questions (Top 100+ Questions and Answers on Java)
  • 2. Q.1: What is Java? Java is a high-level, object-oriented, multithreaded, portable, and platform-independent programming language. It was originally designed by James Gosling at Sun Microsystems in June 1991. In 1995, it was released as a core component of Sun Microsystems. Later, Sun Microsystems was acquired by Oracle and hence Java was henceforth developed by Oracle. Currently, Java is one of the most popular programming languages in the world. It is also considered as the platform because it has its own JRE and API.
  • 3. Q.2: What are the main features of Java? • Simple • Object-oriented • Distributed • Robust • Secure • System Independent • Portable • Multithreaded
  • 4. Q.3: Why pointers are eliminated from Java? Pointers are eliminated from Java because: • Pointers lead to confusion for a program. • Pointers may crash a program easily. For example, if two pointers are added, the program crashes immediately. The same thing can also happen when we forget to free the memory allotted to a variable and reallot it to another variable. • Pointers break security. By using pointers, harmful programs such as viruses and other hacking programs can be developed.
  • 5. Q.4: What is the class? There may be some scenarios where some objects may have similar properties and functions. Such objects belong to the same category which is known as a 'class'. For example, Jacob, James, Smith, etc. belong to a person class. They have the same properties and actions.
  • 6. Q.5: Define an object in Java. How an object is created in Java? An object denotes an instance of a class. It is a real- world entity that contains state and behavior. An object basically consists of the following three characteristics: • State • Behavior • Identity
  • 7. Q.6: What is the difference between an executable file and a class file? An executable file (.exe) contains machine language instructions for the microprocessor and is system dependent. Besides, the class file contains byte code instructions for the JVM and is system independent.
  • 8. Q.7: What is the BYTE code? The BYTE code is an intermediate-level code that is interpreted by the JVM. It is not directly executable on the machine. A BYTE code is a mediator code between Java program and machine code of operating system (OS) and is available in ‘.class’ file. A ‘.class’ file is generated when the Java program or application gets compiled. BYTE code is the same for any OS but machine code differs on each OS.
  • 9. Q.8: What is JVM? The JVM (Java Virtual Machine) is an abstract machine designed to be implemented on the top of existing processors. It hides the underlying operating system (OS) from Java applications. It is actually the heart of the entire Java program execution process.
  • 10. Q.9: What is JRE? JRE stands for the 'Java Runtime Environment'. It is a platform consisting of Java virtual machines, Java libraries, and all other components required to run Java applications and applets.
  • 11. Q.10: What is the Java compiler? A Java compiler is a program that converts Java source code to Java byte code. A basic Java compiler is already included in JDK (Java Development Kit). The Java compiler is known as 'javac'.