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

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

Java question bank
 Java question bank Java question bank
Java question bank
hitzsmakz
 
Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1
Lahari Reddy
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdf
venud11
 

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 (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

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

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?