SlideShare a Scribd company logo
www.p2cinfotech.com

Ph: +1-732-546-3607

JAVA INTERVIEW QUESTIONS AND ANSWERS
What is the difference between procedural and object-oriented programs?
1) In procedural program, programming logic follows certain procedures and the
instructions are executed one after another. In OOP program, unit of program is object,
which is nothing but combination of data and code.
2) In procedural program, data is exposed to the whole program whereas in OOPs
program, it is accessible with in the object and which in turn assures the security of the
code.
What is the difference between Assignment and Initialization?
Assignment can be done as many times as desired whereas initialization can be done
only once.
What is the difference between constructor and method?
Constructor will be automatically invoked when an object is created whereas method has
to be called explicitly.
What is the difference between an argument and a parameter?
While defining method, variables passed in the method are called parameters. While using
those methods, values passed to those variables are called arguments.
What is the difference between overloading and overriding?
1) In overloading, there is a relationship between methods available in the same class
whereas in overriding, there is relationship between a super class method and subclass
method.
2) Overloading does not block inheritance from the super class whereas overriding blocks
inheritance from the super class.
3) In overloading, separate methods share the same name whereas in overriding,
subclass method replaces the super class.
4) Overloading must have different method signatures whereas overriding must have
same signature.
www.prepareinterview.com
What is the difference between this () and super ()?
This () can be used to invoke a constructor of the same class whereas super () can be
used to invoke a super class constructor.
What is the difference between super class and sub class?
A super class is a class that is inherited whereas sub class is a class that does the
inheriting.
What is the difference between String and String Buffer?
1) String objects are constants and immutable whereas String Buffer objects are not.
www.p2cinfotech.com

Ph: +1-732-546-3607

2) String class supports constant strings whereas String Buffer class supports growable
and modifiable strings.
What is the difference between Array and vector?
Array is a set of related data type and static whereas vector is a growable array of objects
and dynamic.
What is the difference between exception and error?
The exception class defines mild error conditions that your program encounters.
Exceptions can occur when trying to open the file, which does not exist, the network
connection is disrupted, operands being manipulated are out of prescribed ranges, the
class file you are interested in loading is missing. The error class defines serious error
conditions that you should not attempt to recover from. In most cases it is advisable to
let the program terminate when such an error is encountered.
What is the difference between process and thread?
Process is a program in execution whereas thread is a separate path of execution in a
program.
What is the difference between abstract class and interface?
1) All the methods declared inside an interface are abstract whereas abstract class must
have at least one abstract method and others may be concrete or abstract.
2) In abstract class, key word abstract must be used for the methods whereas interface
we need not use that keyword for the methods.
3) Abstract class must have subclasses whereas interface can’t have subclasses.
What is the difference between Integer and int?
1) Integer is a class defined in the java. lang package, whereas int is a primitive data
type defined in the Java language itself. Java does not automatically convert from one to
the other.
2) Integer can be used as an argument for a method that requires an object, whereas int
can be used for calculations.
What is the difference between choice and list?
A Choice is displayed in a compact form that requires you to pull it down to see the list of
available choices and only one item may be selected from a choice. A List may be
displayed in such a way that several list items are visible and it supports the selection of
one or more list items.
What is the difference between scrollbar and scrollpane?
A Scrollbar is a Component, but not a Container whereas scrollpane is a conatiner and
handles its own events and perform its own scrolling.
What is the difference between applications and applets?
1) Application must be run on local machine whereas applet needs no explicit installation
on local machine.
2) Application must be run explicitly within a java-compatible virtual machine whereas
applet loads and runs itself automatically in a java-enabled browser.
3) Application starts execution with its main method whereas applet starts execution with
www.p2cinfotech.com

Ph: +1-732-546-3607

its init method.
4) Application can run with or without graphical user interface whereas applet must run
within a graphical user interface.
What is the difference between set and list?
Set stores elements in an unordered way but does not contain duplicate elements,
whereas list stores elements in an ordered way but may contain duplicate elements.
What is the difference between an applet and a servlet?
1) Servlets are to servers what applets are to browsers.
2) Applets must have graphical user interfaces whereas servlets have no graphical user
interfaces.
What is the difference between doPost and doGet methods?
1) doGet() method is used to get information, while doPost() method is used for posting
information.
2) doGet() requests can’t send large amount of information and is limited to 240-255
characters. However, doPost()requests passes all of its data, of unlimited length.
3) A doGet() request is appended to the request URL in a query string and this allows the
exchange is visible to the client, whereas a doPost() request passes directly over the
socket connection as part of its HTTP request body and the exchange are invisible to the
client.
What is the difference between TCP/IP and UDP?
TCP/IP is a two-way communication between the client and the server and it
is a reliable and there is a confirmation regarding reaching the message to the
destination. It is like a phone call.
UDP is a one-way communication only between the client and the server and it
is not a reliable and there is no confirmation regarding reaching the message to the
destination. It is like a postal mail.

DEATAILS:
Website: www.p2cinfotech.com
Email: training@p2cinfotech.com
Phone: +1-732-546-3607

More Related Content

What's hot (19)

PDF
Java/J2EE interview Qestions
Arun Vasanth
 
PDF
201 core java interview questions oo ps interview questions - javatpoint
ravi tyagi
 
DOCX
Core java questions
Pradheep Ayyanar
 
PDF
Java questions for interview
Kuntal Bhowmick
 
PDF
37 Java Interview Questions
Arc & Codementor
 
PPTX
Java interview questions 1
Sherihan Anver
 
DOCX
C# interview quesions
Shashwat Shriparv
 
PPTX
Object+oriented+programming+in+java
Ye Win
 
DOC
C# interview questions
Chetan Chaudhari
 
DOC
C#
LiquidHub
 
PPTX
Top 20 c# interview Question and answers
w3asp dotnet
 
PDF
Class notes(week 9) on multithreading
Kuntal Bhowmick
 
DOC
Core java interview questions1
Lahari Reddy
 
PDF
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
nofakeNews
 
PDF
Core java interview faq
Kumaran K
 
PPTX
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
PPTX
Suga java training_with_footer
Sugavanam Natarajan
 
PDF
Java Concurrency Starter Kit
Mark Papis
 
PDF
Java Interview Questions by NageswaraRao
JavabynataraJ
 
Java/J2EE interview Qestions
Arun Vasanth
 
201 core java interview questions oo ps interview questions - javatpoint
ravi tyagi
 
Core java questions
Pradheep Ayyanar
 
Java questions for interview
Kuntal Bhowmick
 
37 Java Interview Questions
Arc & Codementor
 
Java interview questions 1
Sherihan Anver
 
C# interview quesions
Shashwat Shriparv
 
Object+oriented+programming+in+java
Ye Win
 
C# interview questions
Chetan Chaudhari
 
Top 20 c# interview Question and answers
w3asp dotnet
 
Class notes(week 9) on multithreading
Kuntal Bhowmick
 
Core java interview questions1
Lahari Reddy
 
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
nofakeNews
 
Core java interview faq
Kumaran K
 
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
Suga java training_with_footer
Sugavanam Natarajan
 
Java Concurrency Starter Kit
Mark Papis
 
Java Interview Questions by NageswaraRao
JavabynataraJ
 

Similar to Interview Questions and Answers for Java (20)

DOCX
Intervies
roopa manoharan
 
DOCX
Java interview questions and answers
Madhavendra Dutt
 
DOCX
Java interview questions
Shashwat Shriparv
 
PDF
JAVA INTERVIEW QUESTIONS.pdf java developer engineer
MinElectroneum
 
PDF
JAVA TECHNICAL INTERVIEW.pdf java developer engineer
MinElectroneum
 
DOC
Java interview faq's
Deepak Raj
 
DOC
Faqs in java
prathap kumar
 
DOC
Questions of java
Waseem Wasi
 
PDF
Data Structure Interview Questions & Answers
Satyam Jaiswal
 
PDF
Java question bank
hitzsmakz
 
PDF
java04
mahes3231
 
PDF
Technical_Interview_Questions.pdf
adityashukla939020
 
PPTX
Java J2EE Interview Questions Part-1
javatrainingonline
 
PPTX
Java J2EE Interview Questions Part-1
Mindsmapped Consulting
 
DOC
Java questions and answers jan bask.net
Janbask ItTraining
 
PDF
Tcs NQTExam technical questions
AniketBhandare2
 
PDF
Javainterviewquestions 110607071413-phpapp02
Kumaran K
 
PDF
Javainterviewquestions 110607071413-phpapp02
lakk1234
 
PDF
Probable questions for semester exam
Kuntal Bhowmick
 
Intervies
roopa manoharan
 
Java interview questions and answers
Madhavendra Dutt
 
Java interview questions
Shashwat Shriparv
 
JAVA INTERVIEW QUESTIONS.pdf java developer engineer
MinElectroneum
 
JAVA TECHNICAL INTERVIEW.pdf java developer engineer
MinElectroneum
 
Java interview faq's
Deepak Raj
 
Faqs in java
prathap kumar
 
Questions of java
Waseem Wasi
 
Data Structure Interview Questions & Answers
Satyam Jaiswal
 
Java question bank
hitzsmakz
 
java04
mahes3231
 
Technical_Interview_Questions.pdf
adityashukla939020
 
Java J2EE Interview Questions Part-1
javatrainingonline
 
Java J2EE Interview Questions Part-1
Mindsmapped Consulting
 
Java questions and answers jan bask.net
Janbask ItTraining
 
Tcs NQTExam technical questions
AniketBhandare2
 
Javainterviewquestions 110607071413-phpapp02
Kumaran K
 
Javainterviewquestions 110607071413-phpapp02
lakk1234
 
Probable questions for semester exam
Kuntal Bhowmick
 
Ad

More from Garuda Trainings (14)

PDF
SAP BI 7.0 Info Providers
Garuda Trainings
 
DOC
Short definitions of all testing types
Garuda Trainings
 
PPTX
Software testing life cycle
Garuda Trainings
 
DOCX
Fundamental classes in java
Garuda Trainings
 
DOCX
Java Exception handling
Garuda Trainings
 
DOCX
Performance testing interview questions and answers
Garuda Trainings
 
DOCX
Loadrunner interview questions and answers
Garuda Trainings
 
DOCX
Business analysis interview question and answers
Garuda Trainings
 
DOCX
Quality center interview questions and answers
Garuda Trainings
 
PPT
Software development life cycle
Garuda Trainings
 
PPT
Dot net Online Training | .Net Training and Placement online
Garuda Trainings
 
PDF
Interview questions and answers for quality assurance
Garuda Trainings
 
PDF
Unix commands in etl testing
Garuda Trainings
 
PPTX
SQL for ETL Testing
Garuda Trainings
 
SAP BI 7.0 Info Providers
Garuda Trainings
 
Short definitions of all testing types
Garuda Trainings
 
Software testing life cycle
Garuda Trainings
 
Fundamental classes in java
Garuda Trainings
 
Java Exception handling
Garuda Trainings
 
Performance testing interview questions and answers
Garuda Trainings
 
Loadrunner interview questions and answers
Garuda Trainings
 
Business analysis interview question and answers
Garuda Trainings
 
Quality center interview questions and answers
Garuda Trainings
 
Software development life cycle
Garuda Trainings
 
Dot net Online Training | .Net Training and Placement online
Garuda Trainings
 
Interview questions and answers for quality assurance
Garuda Trainings
 
Unix commands in etl testing
Garuda Trainings
 
SQL for ETL Testing
Garuda Trainings
 
Ad

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPT
digestive system for Pharm d I year HAP
rekhapositivity
 
PPTX
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
PYLORIC STENOSIS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
IDEAS AND EARLY STATES Social science pptx
NIRANJANASSURESH
 
PPTX
Blanket Order in Odoo 17 Purchase App - Odoo Slides
Celine George
 
PPTX
LEGAL ASPECTS OF PSYCHIATRUC NURSING.pptx
PoojaSen20
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
Presentation: Climate Citizenship Digital Education
Karl Donert
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
How to Consolidate Subscription Billing in Odoo 18 Sales
Celine George
 
PDF
FULL DOCUMENT: Read the full Deloitte and Touche audit report on the National...
Kweku Zurek
 
PPTX
Folding Off Hours in Gantt View in Odoo 18.2
Celine George
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PPTX
nutriquiz grade 4.pptx...............................................
ferdinandsanbuenaven
 
PPTX
classroom based quiz bee.pptx...................
ferdinandsanbuenaven
 
PPTX
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
PPTX
HIRSCHSPRUNG'S DISEASE(MEGACOLON): NURSING MANAGMENT.pptx
PRADEEP ABOTHU
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
digestive system for Pharm d I year HAP
rekhapositivity
 
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PYLORIC STENOSIS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
IDEAS AND EARLY STATES Social science pptx
NIRANJANASSURESH
 
Blanket Order in Odoo 17 Purchase App - Odoo Slides
Celine George
 
LEGAL ASPECTS OF PSYCHIATRUC NURSING.pptx
PoojaSen20
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Presentation: Climate Citizenship Digital Education
Karl Donert
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
How to Consolidate Subscription Billing in Odoo 18 Sales
Celine George
 
FULL DOCUMENT: Read the full Deloitte and Touche audit report on the National...
Kweku Zurek
 
Folding Off Hours in Gantt View in Odoo 18.2
Celine George
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
nutriquiz grade 4.pptx...............................................
ferdinandsanbuenaven
 
classroom based quiz bee.pptx...................
ferdinandsanbuenaven
 
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
HIRSCHSPRUNG'S DISEASE(MEGACOLON): NURSING MANAGMENT.pptx
PRADEEP ABOTHU
 

Interview Questions and Answers for Java

  • 1. www.p2cinfotech.com Ph: +1-732-546-3607 JAVA INTERVIEW QUESTIONS AND ANSWERS What is the difference between procedural and object-oriented programs? 1) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination of data and code. 2) In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in turn assures the security of the code. What is the difference between Assignment and Initialization? Assignment can be done as many times as desired whereas initialization can be done only once. What is the difference between constructor and method? Constructor will be automatically invoked when an object is created whereas method has to be called explicitly. What is the difference between an argument and a parameter? While defining method, variables passed in the method are called parameters. While using those methods, values passed to those variables are called arguments. What is the difference between overloading and overriding? 1) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a super class method and subclass method. 2) Overloading does not block inheritance from the super class whereas overriding blocks inheritance from the super class. 3) In overloading, separate methods share the same name whereas in overriding, subclass method replaces the super class. 4) Overloading must have different method signatures whereas overriding must have same signature. www.prepareinterview.com What is the difference between this () and super ()? This () can be used to invoke a constructor of the same class whereas super () can be used to invoke a super class constructor. What is the difference between super class and sub class? A super class is a class that is inherited whereas sub class is a class that does the inheriting. What is the difference between String and String Buffer? 1) String objects are constants and immutable whereas String Buffer objects are not.
  • 2. www.p2cinfotech.com Ph: +1-732-546-3607 2) String class supports constant strings whereas String Buffer class supports growable and modifiable strings. What is the difference between Array and vector? Array is a set of related data type and static whereas vector is a growable array of objects and dynamic. What is the difference between exception and error? The exception class defines mild error conditions that your program encounters. Exceptions can occur when trying to open the file, which does not exist, the network connection is disrupted, operands being manipulated are out of prescribed ranges, the class file you are interested in loading is missing. The error class defines serious error conditions that you should not attempt to recover from. In most cases it is advisable to let the program terminate when such an error is encountered. What is the difference between process and thread? Process is a program in execution whereas thread is a separate path of execution in a program. What is the difference between abstract class and interface? 1) All the methods declared inside an interface are abstract whereas abstract class must have at least one abstract method and others may be concrete or abstract. 2) In abstract class, key word abstract must be used for the methods whereas interface we need not use that keyword for the methods. 3) Abstract class must have subclasses whereas interface can’t have subclasses. What is the difference between Integer and int? 1) Integer is a class defined in the java. lang package, whereas int is a primitive data type defined in the Java language itself. Java does not automatically convert from one to the other. 2) Integer can be used as an argument for a method that requires an object, whereas int can be used for calculations. What is the difference between choice and list? A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices and only one item may be selected from a choice. A List may be displayed in such a way that several list items are visible and it supports the selection of one or more list items. What is the difference between scrollbar and scrollpane? A Scrollbar is a Component, but not a Container whereas scrollpane is a conatiner and handles its own events and perform its own scrolling. What is the difference between applications and applets? 1) Application must be run on local machine whereas applet needs no explicit installation on local machine. 2) Application must be run explicitly within a java-compatible virtual machine whereas applet loads and runs itself automatically in a java-enabled browser. 3) Application starts execution with its main method whereas applet starts execution with
  • 3. www.p2cinfotech.com Ph: +1-732-546-3607 its init method. 4) Application can run with or without graphical user interface whereas applet must run within a graphical user interface. What is the difference between set and list? Set stores elements in an unordered way but does not contain duplicate elements, whereas list stores elements in an ordered way but may contain duplicate elements. What is the difference between an applet and a servlet? 1) Servlets are to servers what applets are to browsers. 2) Applets must have graphical user interfaces whereas servlets have no graphical user interfaces. What is the difference between doPost and doGet methods? 1) doGet() method is used to get information, while doPost() method is used for posting information. 2) doGet() requests can’t send large amount of information and is limited to 240-255 characters. However, doPost()requests passes all of its data, of unlimited length. 3) A doGet() request is appended to the request URL in a query string and this allows the exchange is visible to the client, whereas a doPost() request passes directly over the socket connection as part of its HTTP request body and the exchange are invisible to the client. What is the difference between TCP/IP and UDP? TCP/IP is a two-way communication between the client and the server and it is a reliable and there is a confirmation regarding reaching the message to the destination. It is like a phone call. UDP is a one-way communication only between the client and the server and it is not a reliable and there is no confirmation regarding reaching the message to the destination. It is like a postal mail. DEATAILS: Website: www.p2cinfotech.com Email: [email protected] Phone: +1-732-546-3607