SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 1/11
201 Core Java Interview Questions
90% assurance of interview questions
There is the list of 201 core java interview questions. If there is any
core  java  interview  question  that  have  been  asked  to  you,  kindly
post it in the ask question section. We assure that you will get here
the 90% frequently asked interview questions and answers.
The  answers  of  the  core  java  interview  questions  are  short  and  to
the  point.  The  core  java  interview  questions  are  categorized  in
Basics of java interview questions, OOPs interview questions, String
Handling  interview  questions,  Multithreading  interview  questions,
collection interview questions, JDBC interview questions etc.
1   2   3   4   5   6   7   8
Core Java: Basics of Java Interview Questions
1)  What  is  difference  between  JDK,JRE  and
JVM?
JVM
JVM  is  an  acronym  for  Java  Virtual  Machine,  it  is  an  abstract
machine  which  provides  the  runtime  environment  in  which  java
bytecode can be executed. It is a specification.
JVMs  are  available  for  many  hardware  and  software  platforms  (so
JVM is platform dependent).
JRE
JRE  stands  for  Java  Runtime  Environment.  It  is  the  implementation
of JVM.
JDK
JDK is an acronym for Java Development Kit. It physically exists. It
contains JRE + development tools.
more details...
 
Content Menu
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 2/11
2)  How  many  types  of  memory  areas  are
allocated by JVM?
Many types:
1. Class(Method) Area
2. Heap
3. Stack
4. Program Counter Register
5. Native Method Stack
more details...
3) What is JIT compiler?
Just­In­Time(JIT) compiler:It is used to improve the performance.
JIT compiles parts of the byte code that have similar functionality at
the  same  time,  and  hence  reduces  the  amount  of  time  needed  for
compilation.Here the term “compiler” refers to a translator from the
instruction set of a Java virtual machine (JVM) to the instruction set
of a specific CPU.
4) What is platform?
A  platform  is  basically  the  hardware  or  software  environment  in
which  a  program  runs.  There  are  two  types  of  platforms  software­
based and hardware­based. Java provides software­based platform.
5)  What  is  the  main  difference  between  Java
platform and other platforms?
The  Java  platform  differs  from  most  other  platforms  in  the  sense
that  it's  a  software­based  platform  that  runs  on  top  of  other
hardware­based platforms.It has two components:
1. Runtime Environment
2. API(Application Programming Interface)
6)  What  gives  Java  its  'write  once  and  run
anywhere' nature?
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 3/11
The  bytecode.  Java  is  compiled  to  be  a  byte  code  which  is  the
intermediate language between source code and machine code. This
byte  code  is  not  platform  specific  and  hence  can  be  fed  to  any
platform.
7) What is classloader?
The  classloader  is  a  subsystem  of  JVM  that  is  used  to  load  classes
and  interfaces.There  are  many  types  of  classloaders  e.g.  Bootstrap
classloader,  Extension  classloader,  System  classloader,  Plugin
classloader etc.
8)  Is  Empty  .java  file  name  a  valid  source  file
name?
Yes, save your java file by .java only, compile it by javac .java and
run by java yourclassname Let's take a simple example:
1.  //save by .java only  
2.  class A{  
3.  public static void main(String args[]){  
4.  System.out.println("Hello java");  
5.  }  
6.  }  
7.  //compile by javac .java  
8.  //run by     java A  
compile it by javac .java
run it by java A
9) Is delete,next,main,exit or null keyword in java?
No.
10)  If  I  don't  provide  any  arguments  on  the
command  line,  then  the  String  array  of  Main
method will be empty or null?
It is empty. But not null.
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 4/11
11)  What  if  I  write  static  public  void  instead  of
public static void?
Program compiles and runs properly.
12)  What  is  the  default  value  of  the  local
variables?
The  local  variables  are  not  initialized  to  any  default  value,  neither
primitives nor object references.
Core Java ­ OOPs Concepts: Initial OOPs Interview
Questions
There  is  given  more  than  50  OOPs  (Object­Oriented  Programming
and System) interview questions. But they have been categorized in
many  sections  such  as  constructor  interview  questions,  static
interview  questions,  Inheritance  Interview  questions,  Abstraction
interview question, Polymorphism interview questions etc. for better
understanding.
13)  What  is  difference  between  object  oriented
programming  language  and  object  based
programming language?
Object based programming languages follow all the features of OOPs
except  Inheritance.  Examples  of  object  based  programming
languages are JavaScript, VBScript etc.
14)  What  will  be  the  initial  value  of  an  object
reference  which  is  defined  as  an  instance
variable?
The object references are all initialized to null in Java.
Core Java ­ OOPs Concepts: Constructor Interview
Questions
15) What is constructor?
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 5/11
Constructor  is  just  like  a  method  that  is  used  to  initialize  the
state of an object. It is invoked at the time of object creation.
more details...
16) What is the purpose of default constructor?
The  default  constructor  provides  the  default  values  to  the
objects. The java compiler creates a default constructor only if
there is no constructor in the class.more details...
17) Does constructor return any value?
Ans:yes, that is current instance (You cannot use return type yet it
returns a value).more details...
18)Is constructor inherited?
No, constructor is not inherited.
19) Can you make a constructor final?
No, constructor can't be final.
Core Java ­ OOPs Concepts: static keyword
Interview Questions
20) What is static variable?
static  variable  is  used  to  refer  the  common  property  of  all
objects (that is not unique for each object) e.g. company name
of employees,college name of students etc.
static  variable  gets  memory  only  once  in  class  area  at  the
time of class loading.
more details...
21) What is static method?
A  static  method  belongs  to  the  class  rather  than  object  of  a
class.
A static method can be invoked without the need for creating
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 6/11
an instance of a class.
static method can access static data member and can change
the value of it.
more details...
22) Why main method is static?
because  object  is  not  required  to  call  static  method  if  It  were  non­
static  method,jvm  creats  object  first  then  call  main()  method  that
will lead to the problem of extra memory allocation.more details...
23) What is static block?
Is used to initialize the static data member.
It is excuted before main method at the time of classloading.
more details...
24)  Can  we  execute  a  program  without  main()
method?
Ans) Yes, one of the way is static block.more details...
25) What if the static modifier is removed from the
signature of the main method?
Program  compiles.  But  at  runtime  throws  an  error
"NoSuchMethodError".
26)  What  is  difference  between  static  (class)
method and instance method?
static or class method instance method
1)A  method  i.e.  declared  as  static  is
known as static method.
A  method  i.e.  not
declared  as  static  is
known  as  instance
method.
2)Object  is  not  required  to  call  static
method.
Object  is  required  to
call instance methods.
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 7/11
3)Non­static  (instance)  members  cannot
be  accessed  in  static  context  (static
method,  static  block  and  static  nested
class) directly.
static  and  non­static
variables  both  can  be
accessed  in  instance
methods.
4)For  example:  public  static  int  cube(int
n){ return n*n*n;}
For  example:  public
void msg(){...}.
Core Java ­ OOPs Concepts: Inheritance Interview
Questions
27) What is this in java?
It is a keyword that that refers to the current object.more details...
28)What is Inheritance?
Inheritance  is  a  mechanism  in  which  one  object  acquires  all  the
properties  and  behaviour  of  another  object  of  another  class.  It
represents  IS­A  relationship.  It  is  used  for  Code  Resusability  and
Method Overriding.
more details...
29) Which class is the superclass for every class.
Object class.
30)  Why  multiple  inheritance  is  not  supported  in
java?
To  reduce  the  complexity  and  simplify  the  language,  multiple
inheritance  is  not  supported  in  java  in  case  of  class.more
details...
31) What is composition?
Holding  the  reference  of  the  other  class  within  some  other  class  is
known as composition.
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 8/11
32) What is difference between aggregation and
composition?
Aggregation  represents  weak  relationship  whereas  composition
represents  strong  relationship.  For  example:  bike  has  an  indicator
(aggregation) but bike has an engine (compostion).
33) Why Java does not support pointers?
Pointer  is  a  variable  that  refers  to  the  memory  address.  They  are
not used in java because they are unsafe(unsecured) and complex to
understand.
34) What is super in java?
It  is  a  keyword  that  refers  to  the  immediate  parent  class
object.more details...
35)  Can  you  use  this()  and  super()  both  in  a
constructor?
No. Because super() or this() must be the first statement.
36)What is object cloning?
The  object  cloning  is  used  to  create  the  exact  copy  of  an  object.
more details...
Core Java ­ OOPs Concepts: Method Overloading
Interview Questions
37) What is method overloading?
If  a  class  have  multiple  methods  by  same  name  but  different
parameters,  it  is  known  as  Method  Overloading.  It  increases  the
readability of the program.more details...
38)  Why  method  overloading  is  not  possible  by
changing the return type in java?
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 9/11
Becauseof ambiguity.more details...
39) Can we overload main() method?
Yes,  You  can  have  many  main()  methods  in  a  class  by  overloading
the main method.
more details...
Core Java ­ OOPs Concepts: Method Overriding
Interview Questions
40) What is method overriding:
If a subclass provides a specific implementation of a method that is
already  provided  by  its  parent  class,  it  is  known  as  Method
Overriding. It is used for runtime polymorphism and to provide the
specific implementation of the method.more details...
41) Can we override static method?
No,  you  can't  override  the  static  method  because  they  are  the  part
of class not object.
42) Why we cannot override static method?
It  is  because  the  static  method  is  the  part  of  class  and  it  is  bound
with class whereas instance method is bound with object and static
gets memory in class area and instance gets memory in heap.
43) Can we override the overloaded method?
Yes.
44) Difference between method Overloading and
Overriding.
Method Overloading Method Overriding
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 10/11
1)  Method  overloading
increases  the
readability  of  the
program.
Method  overriding  provides  the  specific
implementation  of  the  method  that  is
already provided by its super class.
2)  method  overlaoding
is  occurs  within  the
class.
Method  overriding  occurs  in  two  classes
that have IS­A relationship.
3)  In  this  case,
parameter  must  be
different.
In this case, parameter must be same.
45) Can you have virtual functions in Java?
Yes, all functions in Java are virtual by default.
46) What is covariant return type?
Now, since java5, it is possible to override any method by changing
the return type if the return type of the subclass overriding method
is subclass type. It is known as covariant return type. more details...
Core Java ­ OOPs Concepts: final keyword Interview
Questions
47) What is final variable?
If  you  make  any  variable  as  final,  you  cannot  change  the  value  of
final variable(It will be constant).more details...
48) What is final method?
Final methods can't be overriden.more details...
49) What is final class?
Final class can't be inherited. more details...
50) What is blank final variable?
7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint
http://www.javatpoint.com/corejava­interview­questions 11/11
next →
A final variable, not initalized at the time of declaration, is known as
blank final variable.more details...
51) Can we intialize blank final variable?
Yes,  only  in  constructor  if  it  is  non­static.  If  it  is  static  blank  final
variable, it can be initialized only in the static block.more details...
52) Can you declare the main method as final?
Yes, such as, public static final void main(String[] args){}.
1   2   3   4   5   6   7   8
Java  Basics  Interview
Questions
Java  OOPs  Interview
Questions
Java  Multithreading
Interview Questions
Java  String  &  Exception
Interview Questions
Java  Collection
Interview Questions
JDBC Interview Questions
Servlet  Interview
Questions
JSP Interview Questions
Spring  Interview
Questions
Hibernate  Interview
Questions
PL/SQL  Interview
Questions
SQL Interview Questions
Oracle  Interview
Questions
Android  Interview
Questions
SQL  Server  Interview
Questions
MySQL  Interview
Questions

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Spring notes
Spring notesSpring notes
Spring notes
 
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
 
JDBC ppt
JDBC pptJDBC ppt
JDBC ppt
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
"허니몬의 마크다운 사용기"
"허니몬의 마크다운 사용기""허니몬의 마크다운 사용기"
"허니몬의 마크다운 사용기"
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 
Django Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIDjango Rest Framework - Building a Web API
Django Rest Framework - Building a Web API
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
 
4. Classes and Methods
4. Classes and Methods4. Classes and Methods
4. Classes and Methods
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Content Management System and WordPress
Content Management System and WordPressContent Management System and WordPress
Content Management System and WordPress
 
Facebook thrift
Facebook thriftFacebook thrift
Facebook thrift
 
Angular 2
Angular 2Angular 2
Angular 2
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
Front end web development
Front end web developmentFront end web development
Front end web development
 

Destaque

Most Asked Java Interview Question and Answer
Most Asked Java Interview Question and AnswerMost Asked Java Interview Question and Answer
Most Asked Java Interview Question and AnswerTOPS Technologies
 
Preview java j2_ee_book
Preview java j2_ee_bookPreview java j2_ee_book
Preview java j2_ee_bookSubhadip Pal
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questionsrithustutorials
 
Java object oriented programming - OOPS
Java object oriented programming - OOPSJava object oriented programming - OOPS
Java object oriented programming - OOPSrithustutorials
 
Advanced data structures slide 1 2
Advanced data structures slide 1 2Advanced data structures slide 1 2
Advanced data structures slide 1 2jomerson remorosa
 
Html, xml and java script
Html, xml and java scriptHtml, xml and java script
Html, xml and java scriptRajeev Uppala
 
Java data structures for principled programmer
Java data structures for principled programmerJava data structures for principled programmer
Java data structures for principled programmerspnr15z
 
Workday hcm interview questions
Workday hcm interview questionsWorkday hcm interview questions
Workday hcm interview questionsenrollmy training
 
Oracle Fusion v/s Workday
Oracle Fusion v/s WorkdayOracle Fusion v/s Workday
Oracle Fusion v/s WorkdayMayda Barsumyan
 
Java 8 ​and ​Best Practices
 Java 8 ​and ​Best Practices Java 8 ​and ​Best Practices
Java 8 ​and ​Best PracticesWSO2
 
Workday training for_employees
Workday training for_employeesWorkday training for_employees
Workday training for_employeesbgadicha
 
Core java interview questions and answers
Core java interview questions and answersCore java interview questions and answers
Core java interview questions and answersSunil Soni
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 

Destaque (16)

Most Asked Java Interview Question and Answer
Most Asked Java Interview Question and AnswerMost Asked Java Interview Question and Answer
Most Asked Java Interview Question and Answer
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Preview java j2_ee_book
Preview java j2_ee_bookPreview java j2_ee_book
Preview java j2_ee_book
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questions
 
Java object oriented programming - OOPS
Java object oriented programming - OOPSJava object oriented programming - OOPS
Java object oriented programming - OOPS
 
Advanced data structures slide 1 2
Advanced data structures slide 1 2Advanced data structures slide 1 2
Advanced data structures slide 1 2
 
Html, xml and java script
Html, xml and java scriptHtml, xml and java script
Html, xml and java script
 
Java data structures for principled programmer
Java data structures for principled programmerJava data structures for principled programmer
Java data structures for principled programmer
 
Workday hcm interview questions
Workday hcm interview questionsWorkday hcm interview questions
Workday hcm interview questions
 
Oracle Fusion v/s Workday
Oracle Fusion v/s WorkdayOracle Fusion v/s Workday
Oracle Fusion v/s Workday
 
Java 8 ​and ​Best Practices
 Java 8 ​and ​Best Practices Java 8 ​and ​Best Practices
Java 8 ​and ​Best Practices
 
Workday training for_employees
Workday training for_employeesWorkday training for_employees
Workday training for_employees
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
Core java interview questions and answers
Core java interview questions and answersCore java interview questions and answers
Core java interview questions and answers
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 

Semelhante a 201 core java interview questions oo ps interview questions - javatpoint

What are the different java interview questions you need to know?
What are the different java interview questions you need to know?What are the different java interview questions you need to know?
What are the different java interview questions you need to know?kanchanmahajan23
 
What are the different java interview questions you need to know?
What are the different java interview questions you need to know?What are the different java interview questions you need to know?
What are the different java interview questions you need to know?kanchanmahajan23
 
Java interview questions
Java interview questionsJava interview questions
Java interview questionsSoba Arjun
 
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdfJAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdfnofakeNews
 
java_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdfjava_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdfakankshasorate1
 
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 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
 
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 questionsGradeup
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questionsRohit Singh
 
Dev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdetDev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdetDevLabs Alliance
 
Top 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDETTop 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDETDevLabs Alliance
 

Semelhante a 201 core java interview questions oo ps interview questions - javatpoint (20)

What are the different java interview questions you need to know?
What are the different java interview questions you need to know?What are the different java interview questions you need to know?
What are the different java interview questions you need to know?
 
What are the different java interview questions you need to know?
What are the different java interview questions you need to know?What are the different java interview questions you need to know?
What are the different java interview questions you need to know?
 
Java introduction
Java introductionJava introduction
Java introduction
 
DAY_1.1.pptx
DAY_1.1.pptxDAY_1.1.pptx
DAY_1.1.pptx
 
Java interview question
Java interview questionJava interview question
Java interview question
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
SOFTWARE TESTING
SOFTWARE TESTINGSOFTWARE TESTING
SOFTWARE TESTING
 
java basic .pdf
java basic .pdfjava basic .pdf
java basic .pdf
 
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdfJAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
 
Java bcs 21_vision academy_final
Java bcs 21_vision academy_finalJava bcs 21_vision academy_final
Java bcs 21_vision academy_final
 
java_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdfjava_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdf
 
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
 
1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
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
 
What is Java? Presentation On Introduction To Core Java By PSK Technologies
What is Java? Presentation On Introduction To Core Java By PSK TechnologiesWhat is Java? Presentation On Introduction To Core Java By PSK Technologies
What is Java? Presentation On Introduction To Core Java By PSK Technologies
 
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
 
Java basics
Java basicsJava basics
Java basics
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questions
 
Dev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdetDev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdet
 
Top 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDETTop 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDET
 

Último

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

201 core java interview questions oo ps interview questions - javatpoint

  • 1. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 1/11 201 Core Java Interview Questions 90% assurance of interview questions There is the list of 201 core java interview questions. If there is any core  java  interview  question  that  have  been  asked  to  you,  kindly post it in the ask question section. We assure that you will get here the 90% frequently asked interview questions and answers. The  answers  of  the  core  java  interview  questions  are  short  and  to the  point.  The  core  java  interview  questions  are  categorized  in Basics of java interview questions, OOPs interview questions, String Handling  interview  questions,  Multithreading  interview  questions, collection interview questions, JDBC interview questions etc. 1   2   3   4   5   6   7   8 Core Java: Basics of Java Interview Questions 1)  What  is  difference  between  JDK,JRE  and JVM? JVM JVM  is  an  acronym  for  Java  Virtual  Machine,  it  is  an  abstract machine  which  provides  the  runtime  environment  in  which  java bytecode can be executed. It is a specification. JVMs  are  available  for  many  hardware  and  software  platforms  (so JVM is platform dependent). JRE JRE  stands  for  Java  Runtime  Environment.  It  is  the  implementation of JVM. JDK JDK is an acronym for Java Development Kit. It physically exists. It contains JRE + development tools. more details...   Content Menu
  • 2. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 2/11 2)  How  many  types  of  memory  areas  are allocated by JVM? Many types: 1. Class(Method) Area 2. Heap 3. Stack 4. Program Counter Register 5. Native Method Stack more details... 3) What is JIT compiler? Just­In­Time(JIT) compiler:It is used to improve the performance. JIT compiles parts of the byte code that have similar functionality at the  same  time,  and  hence  reduces  the  amount  of  time  needed  for compilation.Here the term “compiler” refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU. 4) What is platform? A  platform  is  basically  the  hardware  or  software  environment  in which  a  program  runs.  There  are  two  types  of  platforms  software­ based and hardware­based. Java provides software­based platform. 5)  What  is  the  main  difference  between  Java platform and other platforms? The  Java  platform  differs  from  most  other  platforms  in  the  sense that  it's  a  software­based  platform  that  runs  on  top  of  other hardware­based platforms.It has two components: 1. Runtime Environment 2. API(Application Programming Interface) 6)  What  gives  Java  its  'write  once  and  run anywhere' nature?
  • 3. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 3/11 The  bytecode.  Java  is  compiled  to  be  a  byte  code  which  is  the intermediate language between source code and machine code. This byte  code  is  not  platform  specific  and  hence  can  be  fed  to  any platform. 7) What is classloader? The  classloader  is  a  subsystem  of  JVM  that  is  used  to  load  classes and  interfaces.There  are  many  types  of  classloaders  e.g.  Bootstrap classloader,  Extension  classloader,  System  classloader,  Plugin classloader etc. 8)  Is  Empty  .java  file  name  a  valid  source  file name? Yes, save your java file by .java only, compile it by javac .java and run by java yourclassname Let's take a simple example: 1.  //save by .java only   2.  class A{   3.  public static void main(String args[]){   4.  System.out.println("Hello java");   5.  }   6.  }   7.  //compile by javac .java   8.  //run by     java A   compile it by javac .java run it by java A 9) Is delete,next,main,exit or null keyword in java? No. 10)  If  I  don't  provide  any  arguments  on  the command  line,  then  the  String  array  of  Main method will be empty or null? It is empty. But not null.
  • 4. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 4/11 11)  What  if  I  write  static  public  void  instead  of public static void? Program compiles and runs properly. 12)  What  is  the  default  value  of  the  local variables? The  local  variables  are  not  initialized  to  any  default  value,  neither primitives nor object references. Core Java ­ OOPs Concepts: Initial OOPs Interview Questions There  is  given  more  than  50  OOPs  (Object­Oriented  Programming and System) interview questions. But they have been categorized in many  sections  such  as  constructor  interview  questions,  static interview  questions,  Inheritance  Interview  questions,  Abstraction interview question, Polymorphism interview questions etc. for better understanding. 13)  What  is  difference  between  object  oriented programming  language  and  object  based programming language? Object based programming languages follow all the features of OOPs except  Inheritance.  Examples  of  object  based  programming languages are JavaScript, VBScript etc. 14)  What  will  be  the  initial  value  of  an  object reference  which  is  defined  as  an  instance variable? The object references are all initialized to null in Java. Core Java ­ OOPs Concepts: Constructor Interview Questions 15) What is constructor?
  • 5. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 5/11 Constructor  is  just  like  a  method  that  is  used  to  initialize  the state of an object. It is invoked at the time of object creation. more details... 16) What is the purpose of default constructor? The  default  constructor  provides  the  default  values  to  the objects. The java compiler creates a default constructor only if there is no constructor in the class.more details... 17) Does constructor return any value? Ans:yes, that is current instance (You cannot use return type yet it returns a value).more details... 18)Is constructor inherited? No, constructor is not inherited. 19) Can you make a constructor final? No, constructor can't be final. Core Java ­ OOPs Concepts: static keyword Interview Questions 20) What is static variable? static  variable  is  used  to  refer  the  common  property  of  all objects (that is not unique for each object) e.g. company name of employees,college name of students etc. static  variable  gets  memory  only  once  in  class  area  at  the time of class loading. more details... 21) What is static method? A  static  method  belongs  to  the  class  rather  than  object  of  a class. A static method can be invoked without the need for creating
  • 6. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 6/11 an instance of a class. static method can access static data member and can change the value of it. more details... 22) Why main method is static? because  object  is  not  required  to  call  static  method  if  It  were  non­ static  method,jvm  creats  object  first  then  call  main()  method  that will lead to the problem of extra memory allocation.more details... 23) What is static block? Is used to initialize the static data member. It is excuted before main method at the time of classloading. more details... 24)  Can  we  execute  a  program  without  main() method? Ans) Yes, one of the way is static block.more details... 25) What if the static modifier is removed from the signature of the main method? Program  compiles.  But  at  runtime  throws  an  error "NoSuchMethodError". 26)  What  is  difference  between  static  (class) method and instance method? static or class method instance method 1)A  method  i.e.  declared  as  static  is known as static method. A  method  i.e.  not declared  as  static  is known  as  instance method. 2)Object  is  not  required  to  call  static method. Object  is  required  to call instance methods.
  • 7. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 7/11 3)Non­static  (instance)  members  cannot be  accessed  in  static  context  (static method,  static  block  and  static  nested class) directly. static  and  non­static variables  both  can  be accessed  in  instance methods. 4)For  example:  public  static  int  cube(int n){ return n*n*n;} For  example:  public void msg(){...}. Core Java ­ OOPs Concepts: Inheritance Interview Questions 27) What is this in java? It is a keyword that that refers to the current object.more details... 28)What is Inheritance? Inheritance  is  a  mechanism  in  which  one  object  acquires  all  the properties  and  behaviour  of  another  object  of  another  class.  It represents  IS­A  relationship.  It  is  used  for  Code  Resusability  and Method Overriding. more details... 29) Which class is the superclass for every class. Object class. 30)  Why  multiple  inheritance  is  not  supported  in java? To  reduce  the  complexity  and  simplify  the  language,  multiple inheritance  is  not  supported  in  java  in  case  of  class.more details... 31) What is composition? Holding  the  reference  of  the  other  class  within  some  other  class  is known as composition.
  • 8. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 8/11 32) What is difference between aggregation and composition? Aggregation  represents  weak  relationship  whereas  composition represents  strong  relationship.  For  example:  bike  has  an  indicator (aggregation) but bike has an engine (compostion). 33) Why Java does not support pointers? Pointer  is  a  variable  that  refers  to  the  memory  address.  They  are not used in java because they are unsafe(unsecured) and complex to understand. 34) What is super in java? It  is  a  keyword  that  refers  to  the  immediate  parent  class object.more details... 35)  Can  you  use  this()  and  super()  both  in  a constructor? No. Because super() or this() must be the first statement. 36)What is object cloning? The  object  cloning  is  used  to  create  the  exact  copy  of  an  object. more details... Core Java ­ OOPs Concepts: Method Overloading Interview Questions 37) What is method overloading? If  a  class  have  multiple  methods  by  same  name  but  different parameters,  it  is  known  as  Method  Overloading.  It  increases  the readability of the program.more details... 38)  Why  method  overloading  is  not  possible  by changing the return type in java?
  • 9. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 9/11 Becauseof ambiguity.more details... 39) Can we overload main() method? Yes,  You  can  have  many  main()  methods  in  a  class  by  overloading the main method. more details... Core Java ­ OOPs Concepts: Method Overriding Interview Questions 40) What is method overriding: If a subclass provides a specific implementation of a method that is already  provided  by  its  parent  class,  it  is  known  as  Method Overriding. It is used for runtime polymorphism and to provide the specific implementation of the method.more details... 41) Can we override static method? No,  you  can't  override  the  static  method  because  they  are  the  part of class not object. 42) Why we cannot override static method? It  is  because  the  static  method  is  the  part  of  class  and  it  is  bound with class whereas instance method is bound with object and static gets memory in class area and instance gets memory in heap. 43) Can we override the overloaded method? Yes. 44) Difference between method Overloading and Overriding. Method Overloading Method Overriding
  • 10. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 10/11 1)  Method  overloading increases  the readability  of  the program. Method  overriding  provides  the  specific implementation  of  the  method  that  is already provided by its super class. 2)  method  overlaoding is  occurs  within  the class. Method  overriding  occurs  in  two  classes that have IS­A relationship. 3)  In  this  case, parameter  must  be different. In this case, parameter must be same. 45) Can you have virtual functions in Java? Yes, all functions in Java are virtual by default. 46) What is covariant return type? Now, since java5, it is possible to override any method by changing the return type if the return type of the subclass overriding method is subclass type. It is known as covariant return type. more details... Core Java ­ OOPs Concepts: final keyword Interview Questions 47) What is final variable? If  you  make  any  variable  as  final,  you  cannot  change  the  value  of final variable(It will be constant).more details... 48) What is final method? Final methods can't be overriden.more details... 49) What is final class? Final class can't be inherited. more details... 50) What is blank final variable?
  • 11. 7/13/2016 201 Core Java Interview Questions | OOPs interview questions ­ javatpoint http://www.javatpoint.com/corejava­interview­questions 11/11 next → A final variable, not initalized at the time of declaration, is known as blank final variable.more details... 51) Can we intialize blank final variable? Yes,  only  in  constructor  if  it  is  non­static.  If  it  is  static  blank  final variable, it can be initialized only in the static block.more details... 52) Can you declare the main method as final? Yes, such as, public static final void main(String[] args){}. 1   2   3   4   5   6   7   8 Java  Basics  Interview Questions Java  OOPs  Interview Questions Java  Multithreading Interview Questions Java  String  &  Exception Interview Questions Java  Collection Interview Questions JDBC Interview Questions Servlet  Interview Questions JSP Interview Questions Spring  Interview Questions Hibernate  Interview Questions PL/SQL  Interview Questions SQL Interview Questions Oracle  Interview Questions Android  Interview Questions SQL  Server  Interview Questions MySQL  Interview Questions