SlideShare uma empresa Scribd logo
1 de 3
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

Mais conteúdo relacionado

Mais procurados

Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview QestionsArun Vasanth
 
201 core java interview questions oo ps interview questions - javatpoint
201 core java interview questions   oo ps interview questions - javatpoint201 core java interview questions   oo ps interview questions - javatpoint
201 core java interview questions oo ps interview questions - javatpointravi tyagi
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interviewKuntal Bhowmick
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview QuestionsArc & Codementor
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1Sherihan Anver
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+javaYe Win
 
Top 20 c# interview Question and answers
Top 20 c# interview Question and answersTop 20 c# interview Question and answers
Top 20 c# interview Question and answersw3asp dotnet
 
Class notes(week 9) on multithreading
Class notes(week 9) on multithreadingClass notes(week 9) on multithreading
Class notes(week 9) on multithreadingKuntal Bhowmick
 
Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1Lahari Reddy
 
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdfJAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdfnofakeNews
 
Core java interview faq
Core java interview faqCore java interview faq
Core java interview faqKumaran K
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionPritom Chaki
 
Java Concurrency Starter Kit
Java Concurrency Starter KitJava Concurrency Starter Kit
Java Concurrency Starter KitMark Papis
 
Java Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRaoJava Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRaoJavabynataraJ
 

Mais procurados (19)

Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
201 core java interview questions oo ps interview questions - javatpoint
201 core java interview questions   oo ps interview questions - javatpoint201 core java interview questions   oo ps interview questions - javatpoint
201 core java interview questions oo ps interview questions - javatpoint
 
Core java questions
Core java questionsCore java questions
Core java questions
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interview
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview Questions
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1
 
C# interview quesions
C# interview quesionsC# interview quesions
C# interview quesions
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
 
C# interview questions
C# interview questionsC# interview questions
C# interview questions
 
C#
C#C#
C#
 
Top 20 c# interview Question and answers
Top 20 c# interview Question and answersTop 20 c# interview Question and answers
Top 20 c# interview Question and answers
 
Class notes(week 9) on multithreading
Class notes(week 9) on multithreadingClass notes(week 9) on multithreading
Class notes(week 9) on multithreading
 
Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1
 
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdfJAVA VIVA QUESTIONS_CODERS LODGE.pdf
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
 
Core java interview faq
Core java interview faqCore java interview faq
Core java interview faq
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
 
Suga java training_with_footer
Suga java training_with_footerSuga java training_with_footer
Suga java training_with_footer
 
Java Concurrency Starter Kit
Java Concurrency Starter KitJava Concurrency Starter Kit
Java Concurrency Starter Kit
 
Java Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRaoJava Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRao
 

Semelhante a Java Interview Questions and Answers

Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersMadhavendra Dutt
 
Java interview faq's
Java interview faq'sJava interview faq's
Java interview faq'sDeepak Raj
 
Javainterview
JavainterviewJavainterview
JavainterviewAmarjit03
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersSatyam Jaiswal
 
Technical_Interview_Questions.pdf
Technical_Interview_Questions.pdfTechnical_Interview_Questions.pdf
Technical_Interview_Questions.pdfadityashukla939020
 
Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1javatrainingonline
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questionsAniketBhandare2
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questionsRohit Singh
 
C language 100 questions answers
C language 100 questions answersC language 100 questions answers
C language 100 questions answerssakshitiwari631430
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programmingPraveen Chowdary
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Kumaran K
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02lakk1234
 

Semelhante a Java Interview Questions and Answers (20)

Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Java interview faq's
Java interview faq'sJava interview faq's
Java interview faq's
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Intervies
InterviesIntervies
Intervies
 
Javainterview
JavainterviewJavainterview
Javainterview
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & Answers
 
Core_Java_Interview.pdf
Core_Java_Interview.pdfCore_Java_Interview.pdf
Core_Java_Interview.pdf
 
Technical_Interview_Questions.pdf
Technical_Interview_Questions.pdfTechnical_Interview_Questions.pdf
Technical_Interview_Questions.pdf
 
Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1
 
Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1
 
Java faq's
Java faq'sJava faq's
Java faq's
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questions
 
Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questions
 
C language 100 questions answers
C language 100 questions answersC language 100 questions answers
C language 100 questions answers
 
Java interview question
Java interview questionJava interview question
Java interview question
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02
 
Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02Javainterviewquestions 110607071413-phpapp02
Javainterviewquestions 110607071413-phpapp02
 
Faqs in java
Faqs in javaFaqs in java
Faqs in java
 
C# interview
C# interviewC# interview
C# interview
 

Mais de Garuda Trainings

Short definitions of all testing types
Short definitions of all testing typesShort definitions of all testing types
Short definitions of all testing typesGaruda Trainings
 
Software testing life cycle
Software testing life cycleSoftware testing life cycle
Software testing life cycleGaruda Trainings
 
Fundamental classes in java
Fundamental classes in javaFundamental classes in java
Fundamental classes in javaGaruda Trainings
 
Performance testing interview questions and answers
Performance testing interview questions and answersPerformance testing interview questions and answers
Performance testing interview questions and answersGaruda Trainings
 
Loadrunner interview questions and answers
Loadrunner interview questions and answersLoadrunner interview questions and answers
Loadrunner interview questions and answersGaruda Trainings
 
Business analysis interview question and answers
Business analysis interview question and answersBusiness analysis interview question and answers
Business analysis interview question and answersGaruda Trainings
 
Quality center interview questions and answers
Quality center interview questions and answersQuality center interview questions and answers
Quality center interview questions and answersGaruda Trainings
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycleGaruda Trainings
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineGaruda Trainings
 
Interview questions and answers for quality assurance
Interview questions and answers for quality assuranceInterview questions and answers for quality assurance
Interview questions and answers for quality assuranceGaruda Trainings
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testingGaruda Trainings
 

Mais de Garuda Trainings (14)

SAP BI 7.0 Info Providers
SAP BI 7.0 Info ProvidersSAP BI 7.0 Info Providers
SAP BI 7.0 Info Providers
 
Short definitions of all testing types
Short definitions of all testing typesShort definitions of all testing types
Short definitions of all testing types
 
Software testing life cycle
Software testing life cycleSoftware testing life cycle
Software testing life cycle
 
Fundamental classes in java
Fundamental classes in javaFundamental classes in java
Fundamental classes in java
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Performance testing interview questions and answers
Performance testing interview questions and answersPerformance testing interview questions and answers
Performance testing interview questions and answers
 
Loadrunner interview questions and answers
Loadrunner interview questions and answersLoadrunner interview questions and answers
Loadrunner interview questions and answers
 
Business analysis interview question and answers
Business analysis interview question and answersBusiness analysis interview question and answers
Business analysis interview question and answers
 
Quality center interview questions and answers
Quality center interview questions and answersQuality center interview questions and answers
Quality center interview questions and answers
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycle
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement online
 
Interview questions and answers for quality assurance
Interview questions and answers for quality assuranceInterview questions and answers for quality assurance
Interview questions and answers for quality assurance
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testing
 
SQL for ETL Testing
SQL for ETL TestingSQL for ETL Testing
SQL for ETL Testing
 

Último

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Último (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

Java Interview Questions and Answers

  • 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: training@p2cinfotech.com Phone: +1-732-546-3607