SlideShare a Scribd company logo
1 of 1
Download to read offline
JAVA QUESTIONS 4
1. What is the difference between a constructor and a method?
2. What is the purpose of garbage collection in Java, and when is it used?
3. Describe synchronization in respect to multithreading.
4. What is an abstract class?
5. What is the difference between an Interface and an Abstract class?
6. Explain different way of using thread?
7. What is an Iterator?
8. State the significance of public, private, protected, default modifiers both singly
and in combination and state the effect of package relationships on declared
items qualified by these modifiers.
9. What is static in java?
10.What is final class?
11.What if the main() method is declared as private?
12.What if the static modifier is removed from the signature of the main() method?
13.What if I write static public void instead of public static void?
14.What if I do not provide the String array as the argument to the method?
15.What is the first argument of the String array in main() method?
16.If I do not provide any arguments on the command line, then the String array of
main() method will be empty or null?
17.How can one prove that the array is not null but empty using one line of code?
18.What environment variables do I need to set on my machine in order to be able
to run Java programs?
19.Can an application have multiple classes having main() method?
20.Can I have multiple main() methods in the same class?
21.Do I need to import java.lang package any time? Why ?
22.Can I import same package/class twice? Will the JVM load the package twice at
runtime?
23.What are Checked and UnChecked Exception?
24.What is Overriding?
25.Are the imports checked for validity at compile time? Example: will the code
containing an import such as java.lang.ABCD compile?
26.Does importing a package imports the subpackages as well? Example: Does
importing com.MyTest.* also import com.MyTest.UnitTests.*?
27.What is the difference between declaring a variable and defining a variable?
28.What is the default value of an object reference declared as an instance
variable?
29.Can a top level class be private or protected?
30. What type of parameter passing does Java support?

More Related Content

What's hot

Probable questions for semester exam
Probable questions for semester examProbable questions for semester exam
Probable questions for semester examKuntal Bhowmick
 
JAVA QUESTIONS FOR INTERVIEW-3
JAVA QUESTIONS FOR INTERVIEW-3JAVA QUESTIONS FOR INTERVIEW-3
JAVA QUESTIONS FOR INTERVIEW-3zynofustechnology
 
Interview Questions and Answers for Java
Interview Questions and Answers for JavaInterview Questions and Answers for Java
Interview Questions and Answers for JavaGaruda Trainings
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview QuestionsArc & Codementor
 
Java Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRaoJava Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRaoJavabynataraJ
 
25 java interview questions
25 java interview questions25 java interview questions
25 java interview questionsMehtaacademy
 
Java questions for viva
Java questions for vivaJava questions for viva
Java questions for vivaVipul Naik
 
Java interview-quetions
Java interview-quetionsJava interview-quetions
Java interview-quetionsMehtaacademy
 
Core java training centre in adyar
Core java training centre in adyarCore java training centre in adyar
Core java training centre in adyarsasikalaD3
 

What's hot (11)

Probable questions for semester exam
Probable questions for semester examProbable questions for semester exam
Probable questions for semester exam
 
JAVA QUESTIONS FOR INTERVIEW-3
JAVA QUESTIONS FOR INTERVIEW-3JAVA QUESTIONS FOR INTERVIEW-3
JAVA QUESTIONS FOR INTERVIEW-3
 
JAVA INTERVIEW QUESTIONS -3
JAVA INTERVIEW QUESTIONS -3JAVA INTERVIEW QUESTIONS -3
JAVA INTERVIEW QUESTIONS -3
 
Interview Questions and Answers for Java
Interview Questions and Answers for JavaInterview Questions and Answers for Java
Interview Questions and Answers for Java
 
37 Java Interview Questions
37 Java Interview Questions37 Java Interview Questions
37 Java Interview Questions
 
Java Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRaoJava Interview Questions by NageswaraRao
Java Interview Questions by NageswaraRao
 
Java presentation
Java presentation Java presentation
Java presentation
 
25 java interview questions
25 java interview questions25 java interview questions
25 java interview questions
 
Java questions for viva
Java questions for vivaJava questions for viva
Java questions for viva
 
Java interview-quetions
Java interview-quetionsJava interview-quetions
Java interview-quetions
 
Core java training centre in adyar
Core java training centre in adyarCore java training centre in adyar
Core java training centre in adyar
 

Similar to Java Interview Questions - 4

Top 10 Interview Questions For Java
Top 10 Interview Questions For JavaTop 10 Interview Questions For Java
Top 10 Interview Questions For JavaEME Technologies
 
Java Core Parctical
Java Core ParcticalJava Core Parctical
Java Core ParcticalGaurav Mehta
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questionssoniajessica2
 
Java question bank
 Java question bank Java question bank
Java question bankhitzsmakz
 
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 jobGaruda Trainings
 
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...SynergisticMedia
 
Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1javatrainingonline
 
Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1Lahari Reddy
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdfvenud11
 
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...Ankit Kumar
 
Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...
Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...
Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...AJEET KUMAR
 

Similar to Java Interview Questions - 4 (20)

Top 10 Interview Questions For Java
Top 10 Interview Questions For JavaTop 10 Interview Questions For Java
Top 10 Interview Questions For Java
 
Java interview question
Java interview questionJava interview question
Java interview question
 
Java Core Parctical
Java Core ParcticalJava Core Parctical
Java Core Parctical
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
C# interview questions
C# interview questionsC# interview questions
C# interview questions
 
Java Core
Java CoreJava Core
Java Core
 
Java question bank
 Java question bank Java question bank
Java question bank
 
Core java questions
Core java questionsCore java questions
Core java questions
 
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
 
Core java questions
Core java questionsCore java questions
Core java questions
 
Core java questions
Core java questionsCore java questions
Core java questions
 
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Expe...
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
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
 
Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdf
 
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
 
Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...
Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...
Top 1000 Java Interview Questions_ Includes Spring, Hibernate, Microservices,...
 
Intervies
InterviesIntervies
Intervies
 

More from zynofustechnology

PYTHON INTERVIEW QUESTIONS-4
PYTHON INTERVIEW QUESTIONS-4PYTHON INTERVIEW QUESTIONS-4
PYTHON INTERVIEW QUESTIONS-4zynofustechnology
 
PYTHON INTERVIEW QUESTIONS-2
PYTHON INTERVIEW QUESTIONS-2PYTHON INTERVIEW QUESTIONS-2
PYTHON INTERVIEW QUESTIONS-2zynofustechnology
 
SQL Interview Questions For Experienced
SQL Interview Questions For ExperiencedSQL Interview Questions For Experienced
SQL Interview Questions For Experiencedzynofustechnology
 
Software Testing Interview Questions For Experienced
Software Testing Interview Questions For ExperiencedSoftware Testing Interview Questions For Experienced
Software Testing Interview Questions For Experiencedzynofustechnology
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experiencedzynofustechnology
 
Python Interview Questions For Freshers
Python Interview Questions For FreshersPython Interview Questions For Freshers
Python Interview Questions For Fresherszynofustechnology
 
Java Interview Questions For Freshers
Java Interview Questions For FreshersJava Interview Questions For Freshers
Java Interview Questions For Fresherszynofustechnology
 
Digital marketing questions -3
Digital marketing questions -3Digital marketing questions -3
Digital marketing questions -3zynofustechnology
 
Digital marketing questions -2
Digital marketing questions -2Digital marketing questions -2
Digital marketing questions -2zynofustechnology
 
Digital marketing questions 1
Digital marketing questions  1Digital marketing questions  1
Digital marketing questions 1zynofustechnology
 

More from zynofustechnology (11)

PYTHON INTERVIEW QUESTIONS-4
PYTHON INTERVIEW QUESTIONS-4PYTHON INTERVIEW QUESTIONS-4
PYTHON INTERVIEW QUESTIONS-4
 
PYTHON INTERVIEW QUESTIONS-2
PYTHON INTERVIEW QUESTIONS-2PYTHON INTERVIEW QUESTIONS-2
PYTHON INTERVIEW QUESTIONS-2
 
SQL Interview Questions For Experienced
SQL Interview Questions For ExperiencedSQL Interview Questions For Experienced
SQL Interview Questions For Experienced
 
Software Testing Interview Questions For Experienced
Software Testing Interview Questions For ExperiencedSoftware Testing Interview Questions For Experienced
Software Testing Interview Questions For Experienced
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
 
Python Interview Questions For Freshers
Python Interview Questions For FreshersPython Interview Questions For Freshers
Python Interview Questions For Freshers
 
Java Interview Questions For Freshers
Java Interview Questions For FreshersJava Interview Questions For Freshers
Java Interview Questions For Freshers
 
HR interview questions
HR interview questionsHR interview questions
HR interview questions
 
Digital marketing questions -3
Digital marketing questions -3Digital marketing questions -3
Digital marketing questions -3
 
Digital marketing questions -2
Digital marketing questions -2Digital marketing questions -2
Digital marketing questions -2
 
Digital marketing questions 1
Digital marketing questions  1Digital marketing questions  1
Digital marketing questions 1
 

Recently uploaded

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Recently uploaded (20)

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

Java Interview Questions - 4

  • 1. JAVA QUESTIONS 4 1. What is the difference between a constructor and a method? 2. What is the purpose of garbage collection in Java, and when is it used? 3. Describe synchronization in respect to multithreading. 4. What is an abstract class? 5. What is the difference between an Interface and an Abstract class? 6. Explain different way of using thread? 7. What is an Iterator? 8. State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers. 9. What is static in java? 10.What is final class? 11.What if the main() method is declared as private? 12.What if the static modifier is removed from the signature of the main() method? 13.What if I write static public void instead of public static void? 14.What if I do not provide the String array as the argument to the method? 15.What is the first argument of the String array in main() method? 16.If I do not provide any arguments on the command line, then the String array of main() method will be empty or null? 17.How can one prove that the array is not null but empty using one line of code? 18.What environment variables do I need to set on my machine in order to be able to run Java programs? 19.Can an application have multiple classes having main() method? 20.Can I have multiple main() methods in the same class? 21.Do I need to import java.lang package any time? Why ? 22.Can I import same package/class twice? Will the JVM load the package twice at runtime? 23.What are Checked and UnChecked Exception? 24.What is Overriding? 25.Are the imports checked for validity at compile time? Example: will the code containing an import such as java.lang.ABCD compile? 26.Does importing a package imports the subpackages as well? Example: Does importing com.MyTest.* also import com.MyTest.UnitTests.*? 27.What is the difference between declaring a variable and defining a variable? 28.What is the default value of an object reference declared as an instance variable? 29.Can a top level class be private or protected? 30. What type of parameter passing does Java support?