SlideShare a Scribd company logo
Java
Java Interview Questions
What are the Main features of Java?
 Object Oriented: Java is an object Oriented language where everything is
done keeping objects (data) in mind.
 Simple: Java is very easy to learn and follow. It’s syntax are very easy . Any
programmer who has some basic knowledge about any object oriented
language like c++ can easily follow Java.
 Platform Independent: Java is a write once, run everywhere language. That
means java program written on one platform can be run on any other
platforms without much difficulties.
 Secured: Java is a highly secured language through which you can develop
virus-free and highly secured applications
 Robust: Java is a robust because of automatic garbage collection, better
exception and error handling mechanism, no explicit use of pointers and
better memory management system.
What are the Main features of Java?
 Portable: Java is portable because you can run java byte code on any
hardware which has compliant JVM which converts byte-code according to
that particular hardware.
 Multithreaded: Java supports multithreaded programming where multiple
threads execute their task simultaneously.
 Distributed: Java is distributed because you can develop distributed large
applications using Java concepts like RMI and EJB.
 Dynamic: Java is a dynamic language because it supports loading of classes on
demand.
 Extensible: You can develop new classes using existing interfaces, you can
declare new methods
What are the Main features of Java?
 Functional Style Programming: With the introduction of lambda expressions,
functional interfaces and Stream API in Java 8 you can also write
Functional style of programming in Java
What is the latest version of Java?
 Java 17 or JDK 17 is the latest version of Java which is released on September
14, 2021. (Keep checking Oracle website for latest Java releases).
What are the fundamental principles
of object oriented programming?
 Inheritance
 Abstraction
 Polymorphism
 Encapsulation
What do you mean by inheritance in
Java?
 Inheritance is one of the key principle of object oriented programming.
Through inheritance, one class can inherit the properties of another class.
The class from which properties are inherited is called super class and the
class to which properties are inherited is called sub class.
What are the different types of
inheritance?
 a) Single Inheritance : One class is extended by only one class.
 b) Multilevel Inheritance : One class is extended by a class and that class in turn is extended
by another class thus forming a chain of inheritance.
 c) Hierarchical Inheritance : One class is extended by many classes. Her class thus forming a
chain of inheritance.
 d) Hybrid Inheritance : It is a combination of above types of inheritance.
 e) Multiple Inheritance : One class extends more than one classes. (Java does not support
multiple inheritance)
 6) does Java supports multiple inheritance? If not, why?
 To avoid ambiguity, complexity and confusion, Java does not supports multiple inheritance.
i.e. a class in Java can not extend more than one classes. For example, if Class C extends
Class A and Class B which have a method with same name, then Class C will have two
methods with same name. This causes ambiguity and confusion for which method to use. To
avoid this, Java does not supports multiple inheritance.
What are the different types of
inheritance?
 a) Single Inheritance : One class is extended by only one class.
 b) Multilevel Inheritance : One class is extended by a class and that class in
turn is extended by another class thus forming a chain of inheritance.
 c) Hierarchical Inheritance : One class is extended by many classes. Her class
thus forming a chain of inheritance.
 d) Hybrid Inheritance : It is a combination of above types of inheritance.
 e) Multiple Inheritance : One class extends more than one classes. (Java does
not support multiple inheritance)
does Java supports multiple
inheritance? If not, why?
 To avoid ambiguity, complexity and confusion, Java does not supports
multiple inheritance. i.e. a class in Java can not extend more than one
classes. For example, if Class C extends Class A and Class B which have a
method with same name, then Class C will have two methods with same
name. This causes ambiguity and confusion for which method to use. To avoid
this, Java does not supports multiple inheritance.
If Java doesn’t supports multiple
inheritance, then how do you implement
multiple inheritance in Java?
 Through interfaces, we can implement multiple inheritance in Java. A class in
Java can not extend more than one classes, but a class can implement more
than one interfaces.
What is the parent class of all classes
in Java?
 Java.lang.Object class
You know that all classes in Java are
inherited from java.lang.Object class. Do
interfaces also inherited from
java.lang.Object class?
 No only classes in Java are inherited from java.lang.object class. Interfaces in
 Java are not inherited from java.lang.object class. But, classes which
implement interfaces are inherited from java.lang.Object Class
How do you restrict a member of a class
from inheriting to it’s sub classes?
 By declaring that member as a private. Because, private members are not
inherited to sub classes.
Can a class extend itself?
 No, a class can not extend itself.

More Related Content

What's hot

The smartpath information systems java
The smartpath information systems javaThe smartpath information systems java
The smartpath information systems java
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O
Jyothishmathi Institute of Technology and Science Karimnagar
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview Questions
Arc & Codementor
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Javabackdoor
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1
Sherihan Anver
 
Oops in Java
Oops in JavaOops in Java
Oops in Java
malathip12
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
Arun Vasanth
 
Core java notes with examples
Core java notes with examplesCore java notes with examples
Core java notes with examples
bindur87
 
OCA Java SE 8 Exam Chapter 5 Class Design
OCA Java SE 8 Exam Chapter 5 Class DesignOCA Java SE 8 Exam Chapter 5 Class Design
OCA Java SE 8 Exam Chapter 5 Class Design
İbrahim Kürce
 
Questions of java
Questions of javaQuestions of java
Questions of java
Waseem Wasi
 
Java classes and objects interview questions
Java classes and objects interview questionsJava classes and objects interview questions
Java classes and objects interview questionsDhivyashree Selvarajtnkpm
 
Core java by amit
Core java by amitCore java by amit
Core java by amit
Thakur Amit Tomer
 
11 advance inheritance_concepts
11 advance inheritance_concepts11 advance inheritance_concepts
11 advance inheritance_conceptsArriz San Juan
 
Java interface
Java interface Java interface
Java interface
HoneyChintal
 
Java
JavaJava
Reflection in Java
Reflection in JavaReflection in Java
Reflection in Java
Nikhil Bhardwaj
 
Chapter 9 java
Chapter 9 javaChapter 9 java
Chapter 9 java
Ahmad sohail Kakar
 

What's hot (20)

The smartpath information systems java
The smartpath information systems javaThe smartpath information systems java
The smartpath information systems java
 
Suga java training_with_footer
Suga java training_with_footerSuga java training_with_footer
Suga java training_with_footer
 
JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview Questions
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1
 
Oops in Java
Oops in JavaOops in Java
Oops in Java
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
Unit 4 Java
Unit 4 JavaUnit 4 Java
Unit 4 Java
 
Core java notes with examples
Core java notes with examplesCore java notes with examples
Core java notes with examples
 
OCA Java SE 8 Exam Chapter 5 Class Design
OCA Java SE 8 Exam Chapter 5 Class DesignOCA Java SE 8 Exam Chapter 5 Class Design
OCA Java SE 8 Exam Chapter 5 Class Design
 
Java interview
Java interviewJava interview
Java interview
 
Questions of java
Questions of javaQuestions of java
Questions of java
 
Java classes and objects interview questions
Java classes and objects interview questionsJava classes and objects interview questions
Java classes and objects interview questions
 
Core java by amit
Core java by amitCore java by amit
Core java by amit
 
11 advance inheritance_concepts
11 advance inheritance_concepts11 advance inheritance_concepts
11 advance inheritance_concepts
 
Java interface
Java interface Java interface
Java interface
 
Java
JavaJava
Java
 
Reflection in Java
Reflection in JavaReflection in Java
Reflection in Java
 
Chapter 9 java
Chapter 9 javaChapter 9 java
Chapter 9 java
 

Similar to Java interview-quetions

Object Oriented Programming - 7.1. Inheritance
Object Oriented Programming - 7.1. InheritanceObject Oriented Programming - 7.1. Inheritance
Object Oriented Programming - 7.1. Inheritance
AndiNurkholis1
 
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLTAutomation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Ankit Prajapati
 
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLTAutomation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Ankit Prajapati
 
java_vyshali.pdf
java_vyshali.pdfjava_vyshali.pdf
java_vyshali.pdf
Vyshali6
 
Java_notes.ppt
Java_notes.pptJava_notes.ppt
Java_notes.ppt
tuyambazejeanclaude
 
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
SynergisticMedia
 
1
11
Java OOPS Concept
Java OOPS ConceptJava OOPS Concept
Java OOPS Concept
Richa Gupta
 
Java Interview Questions For Freshers
Java Interview Questions For FreshersJava Interview Questions For Freshers
Java Interview Questions For Freshers
zynofustechnology
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
Kuntal Bhowmick
 
Introduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentationIntroduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentation
BhanuPrakashChirra
 
JAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docx
JAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docxJAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docx
JAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docx
olsenlinnea427
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
Nivegeetha
 
Java ppt
Java pptJava ppt
Java ppt
Apsara G
 
20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
Gradeup
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a job
Garuda Trainings
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
vmadan89
 

Similar to Java interview-quetions (20)

Object Oriented Programming - 7.1. Inheritance
Object Oriented Programming - 7.1. InheritanceObject Oriented Programming - 7.1. Inheritance
Object Oriented Programming - 7.1. Inheritance
 
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLTAutomation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLT
 
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLTAutomation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLT
 
java_vyshali.pdf
java_vyshali.pdfjava_vyshali.pdf
java_vyshali.pdf
 
Java_notes.ppt
Java_notes.pptJava_notes.ppt
Java_notes.ppt
 
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
 
1
11
1
 
Unit 4
Unit 4Unit 4
Unit 4
 
Java OOPS Concept
Java OOPS ConceptJava OOPS Concept
Java OOPS Concept
 
Java Interview Questions For Freshers
Java Interview Questions For FreshersJava Interview Questions For Freshers
Java Interview Questions For Freshers
 
Core java questions
Core java questionsCore java questions
Core java questions
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
Introduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentationIntroduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentation
 
JAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docx
JAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docxJAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docx
JAVA ITCS 1213 Self-check Quiz Interfaces 1) What is an interface comp.docx
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
 
Java ppt
Java pptJava ppt
Java ppt
 
20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
 
C# question answers
C# question answersC# question answers
C# question answers
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a job
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 

Recently uploaded

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 

Recently uploaded (20)

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 

Java interview-quetions

  • 2. What are the Main features of Java?  Object Oriented: Java is an object Oriented language where everything is done keeping objects (data) in mind.  Simple: Java is very easy to learn and follow. It’s syntax are very easy . Any programmer who has some basic knowledge about any object oriented language like c++ can easily follow Java.  Platform Independent: Java is a write once, run everywhere language. That means java program written on one platform can be run on any other platforms without much difficulties.  Secured: Java is a highly secured language through which you can develop virus-free and highly secured applications  Robust: Java is a robust because of automatic garbage collection, better exception and error handling mechanism, no explicit use of pointers and better memory management system.
  • 3. What are the Main features of Java?  Portable: Java is portable because you can run java byte code on any hardware which has compliant JVM which converts byte-code according to that particular hardware.  Multithreaded: Java supports multithreaded programming where multiple threads execute their task simultaneously.  Distributed: Java is distributed because you can develop distributed large applications using Java concepts like RMI and EJB.  Dynamic: Java is a dynamic language because it supports loading of classes on demand.  Extensible: You can develop new classes using existing interfaces, you can declare new methods
  • 4. What are the Main features of Java?  Functional Style Programming: With the introduction of lambda expressions, functional interfaces and Stream API in Java 8 you can also write Functional style of programming in Java
  • 5. What is the latest version of Java?  Java 17 or JDK 17 is the latest version of Java which is released on September 14, 2021. (Keep checking Oracle website for latest Java releases).
  • 6. What are the fundamental principles of object oriented programming?  Inheritance  Abstraction  Polymorphism  Encapsulation
  • 7. What do you mean by inheritance in Java?  Inheritance is one of the key principle of object oriented programming. Through inheritance, one class can inherit the properties of another class. The class from which properties are inherited is called super class and the class to which properties are inherited is called sub class.
  • 8. What are the different types of inheritance?  a) Single Inheritance : One class is extended by only one class.  b) Multilevel Inheritance : One class is extended by a class and that class in turn is extended by another class thus forming a chain of inheritance.  c) Hierarchical Inheritance : One class is extended by many classes. Her class thus forming a chain of inheritance.  d) Hybrid Inheritance : It is a combination of above types of inheritance.  e) Multiple Inheritance : One class extends more than one classes. (Java does not support multiple inheritance)  6) does Java supports multiple inheritance? If not, why?  To avoid ambiguity, complexity and confusion, Java does not supports multiple inheritance. i.e. a class in Java can not extend more than one classes. For example, if Class C extends Class A and Class B which have a method with same name, then Class C will have two methods with same name. This causes ambiguity and confusion for which method to use. To avoid this, Java does not supports multiple inheritance.
  • 9. What are the different types of inheritance?  a) Single Inheritance : One class is extended by only one class.  b) Multilevel Inheritance : One class is extended by a class and that class in turn is extended by another class thus forming a chain of inheritance.  c) Hierarchical Inheritance : One class is extended by many classes. Her class thus forming a chain of inheritance.  d) Hybrid Inheritance : It is a combination of above types of inheritance.  e) Multiple Inheritance : One class extends more than one classes. (Java does not support multiple inheritance)
  • 10. does Java supports multiple inheritance? If not, why?  To avoid ambiguity, complexity and confusion, Java does not supports multiple inheritance. i.e. a class in Java can not extend more than one classes. For example, if Class C extends Class A and Class B which have a method with same name, then Class C will have two methods with same name. This causes ambiguity and confusion for which method to use. To avoid this, Java does not supports multiple inheritance.
  • 11. If Java doesn’t supports multiple inheritance, then how do you implement multiple inheritance in Java?  Through interfaces, we can implement multiple inheritance in Java. A class in Java can not extend more than one classes, but a class can implement more than one interfaces.
  • 12. What is the parent class of all classes in Java?  Java.lang.Object class
  • 13. You know that all classes in Java are inherited from java.lang.Object class. Do interfaces also inherited from java.lang.Object class?  No only classes in Java are inherited from java.lang.object class. Interfaces in  Java are not inherited from java.lang.object class. But, classes which implement interfaces are inherited from java.lang.Object Class
  • 14. How do you restrict a member of a class from inheriting to it’s sub classes?  By declaring that member as a private. Because, private members are not inherited to sub classes.
  • 15. Can a class extend itself?  No, a class can not extend itself.