SlideShare a Scribd company logo
Java & JEE Training
Session 19 – Review Sessions
Page 2Classification: Restricted
Agenda
• How to prepare for a typical Java interview?
• Typical interview questions…
Page 3Classification: Restricted
Explain the different access modifiers..
• Public
• Private
• Default
• Protected
Page 4Classification: Restricted
Code output?
Page 5Classification: Restricted
Code output?
c. Autoboxing will convert a short to a Short, but not to an Integer.
Page 6Classification: Restricted
Code output?
Page 7Classification: Restricted
Code output?
a. "j" will be converted to an Integer automatically when it is
passed to compareTo().
Page 8Classification: Restricted
Code output?
Page 9Classification: Restricted
Code output?
d. "i" will not be converted to an Integer automatically
because there is no assignment nor casting there.
Page 10Classification: Restricted
What is the output?
Page 11Classification: Restricted
What is the output?
It will print “a”. The g() in Bar is not overriding the g() in Foo. It is just overloading the name
"g". When determining which method to call, autoboxing is not considered first so only the
g() in Foo is applicable and thus is used.
Page 12Classification: Restricted
True or False
“X extends Y” is correct if and only if X is a class and Y is an interface.
Page 13Classification: Restricted
True or False
“X extends Y” is correct if and only if X is a class and Y is an interface.
False
Page 14Classification: Restricted
Question
Page 15Classification: Restricted
Question
B and D
Page 16Classification: Restricted
What is the output?
Page 17Classification: Restricted
What is the output?
Compilation error on lines that print f.a and f.b
Page 18Classification: Restricted
Which of these is not correct?
Page 19Classification: Restricted
Which of these is not correct?
All are correct
Page 20Classification: Restricted
What is the output?
Page 21Classification: Restricted
What is the output?
Compilation error… cannot invoke countGold from
static context
Page 22Classification: Restricted
What is the difference between a List and a
Set?
Set:
HashSet: Default Set …must implement equals and hashCode
LinkedHashSet: Maintains the elements in the order in which they were
entered
TreeSet: Maintains in ascending order/sorted
TreeSet<Student> ts = new TreeSet<Student>();
Comparable: Default comparison logic…. Student implements Comparable…
override compareTo()
Comparator: Multiple Comparator classes by implementing Comparator and
overriding compare()
Page 23Classification: Restricted
What is the difference between a List and a
Set?
• List, by default characteristic maintains order; a set does not.
• A set does not entertain duplicate members; whereas a List does
Page 24Classification: Restricted
Topics to be covered in next session
• Collections – Maps
• Map Interface
• Map methods
• Map views
• Map.Entry
• HashMap and TreeMap
• HashMap
• HashMap Constructors
• HashMap Methods
• Utilities
Page 25Classification: Restricted
Thank you!

More Related Content

PPTX
Review Session and Attending Java Interviews
RatnaJava
 
PPTX
Session 18 - Review Session and Attending Java Interviews
PawanMM
 
PPTX
Session 07 - Intro to Object Oriented Programming with Java
PawanMM
 
PPSX
Review Session - Part -2
Hitesh-Java
 
PPTX
Session 16 - Collections - Sorting, Comparing Basics
PawanMM
 
PPSX
Exception Handling - Continued
Hitesh-Java
 
PPSX
OOP with Java - Abstract Classes and Interfaces
Hitesh-Java
 
PPTX
Session 10 - OOP with Java - Abstract Classes and Interfaces
PawanMM
 
Review Session and Attending Java Interviews
RatnaJava
 
Session 18 - Review Session and Attending Java Interviews
PawanMM
 
Session 07 - Intro to Object Oriented Programming with Java
PawanMM
 
Review Session - Part -2
Hitesh-Java
 
Session 16 - Collections - Sorting, Comparing Basics
PawanMM
 
Exception Handling - Continued
Hitesh-Java
 
OOP with Java - Abstract Classes and Interfaces
Hitesh-Java
 
Session 10 - OOP with Java - Abstract Classes and Interfaces
PawanMM
 

What's hot (20)

PDF
Session 1.2 high-precision, context-free entity linking exploiting unambigu...
semanticsconference
 
PPTX
Session 03 - Elements of Java Language
PawanMM
 
PPSX
Inner Classes
Hitesh-Java
 
PPSX
OOPs with Java - Packaging and Access Modifiers
Hitesh-Java
 
PDF
Core Java Training in Noida
Tech Mentro
 
PDF
IBM Watson Technical Deep Dive Swiss Group for Artificial Intelligence and Co...
Romeo Kienzler
 
PPTX
Session 11 - OOP's with Java - Packaging and Access Modifiers
PawanMM
 
PDF
Inner Classes in Java
Dallington Asingwire
 
PDF
Object Oriented Concepts in Real Projects
EPAM
 
PDF
Object oriented programming interview questions
Keet Sugathadasa
 
PPT
OOP programming
anhdbh
 
PDF
Beginning OOP in PHP
David Stockton
 
PPTX
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
Iman Mirrezaei
 
PPT
L5 classes, objects, nested and inner class
teach4uin
 
PDF
Data Structure Interview Questions & Answers
Satyam Jaiswal
 
PDF
Best C Sharp C# Training Online C# Online Course C# Online Training Best on...
Evanta Technologies
 
PPTX
Classes And Objects
rahulsahay19
 
PDF
Object oriented programming With C#
Youssef Mohammed Abohaty
 
PPTX
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Simplilearn
 
PPT
20. Object-Oriented Programming Fundamental Principles
Intro C# Book
 
Session 1.2 high-precision, context-free entity linking exploiting unambigu...
semanticsconference
 
Session 03 - Elements of Java Language
PawanMM
 
Inner Classes
Hitesh-Java
 
OOPs with Java - Packaging and Access Modifiers
Hitesh-Java
 
Core Java Training in Noida
Tech Mentro
 
IBM Watson Technical Deep Dive Swiss Group for Artificial Intelligence and Co...
Romeo Kienzler
 
Session 11 - OOP's with Java - Packaging and Access Modifiers
PawanMM
 
Inner Classes in Java
Dallington Asingwire
 
Object Oriented Concepts in Real Projects
EPAM
 
Object oriented programming interview questions
Keet Sugathadasa
 
OOP programming
anhdbh
 
Beginning OOP in PHP
David Stockton
 
The Triplex Approach for Recognizing Semantic Relations from Noun Phrases, Ap...
Iman Mirrezaei
 
L5 classes, objects, nested and inner class
teach4uin
 
Data Structure Interview Questions & Answers
Satyam Jaiswal
 
Best C Sharp C# Training Online C# Online Course C# Online Training Best on...
Evanta Technologies
 
Classes And Objects
rahulsahay19
 
Object oriented programming With C#
Youssef Mohammed Abohaty
 
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Simplilearn
 
20. Object-Oriented Programming Fundamental Principles
Intro C# Book
 
Ad

Similar to Session 19 - Review Session (20)

PPSX
Review Session and Attending Java Interviews
Hitesh-Java
 
PPTX
Session 14 - Object Class
PawanMM
 
PPSX
Object Class
Hitesh-Java
 
PPTX
Java Collection
DeeptiJava
 
PPTX
Object Class
RatnaJava
 
PPTX
Java Access Specifier
DeeptiJava
 
PPSX
Core Java for Selenium
Rajathi-QA
 
PPTX
Session 04 - Arrays in Java
PawanMM
 
PPSX
Arrays in Java
Hitesh-Java
 
PPTX
Session 06 - Java Basics
SiddharthSelenium
 
PPTX
Introduction to Java Part-3
RatnaJava
 
PPTX
Object Oriented Programming
RatnaJava
 
PPTX
Introduction to Java
DeeptiJava
 
PPTX
Introduction to Java
AathikaJava
 
PPSX
Intro to Object Oriented Programming with Java
Hitesh-Java
 
PPSX
Core Java Basics
Fayis-QA
 
PPTX
Session 38 - Core Java (New Features) - Part 1
PawanMM
 
PPTX
Java OOPs
DeeptiJava
 
PPTX
Java 8, lambdas, generics: How to survive? - NYC Java Meetup Group
Henri Tremblay
 
PPTX
Overview of Java
AnandMHadoop
 
Review Session and Attending Java Interviews
Hitesh-Java
 
Session 14 - Object Class
PawanMM
 
Object Class
Hitesh-Java
 
Java Collection
DeeptiJava
 
Object Class
RatnaJava
 
Java Access Specifier
DeeptiJava
 
Core Java for Selenium
Rajathi-QA
 
Session 04 - Arrays in Java
PawanMM
 
Arrays in Java
Hitesh-Java
 
Session 06 - Java Basics
SiddharthSelenium
 
Introduction to Java Part-3
RatnaJava
 
Object Oriented Programming
RatnaJava
 
Introduction to Java
DeeptiJava
 
Introduction to Java
AathikaJava
 
Intro to Object Oriented Programming with Java
Hitesh-Java
 
Core Java Basics
Fayis-QA
 
Session 38 - Core Java (New Features) - Part 1
PawanMM
 
Java OOPs
DeeptiJava
 
Java 8, lambdas, generics: How to survive? - NYC Java Meetup Group
Henri Tremblay
 
Overview of Java
AnandMHadoop
 
Ad

More from PawanMM (20)

PPTX
Session 48 - JS, JSON and AJAX
PawanMM
 
PPTX
Session 46 - Spring - Part 4 - Spring MVC
PawanMM
 
PPTX
Session 45 - Spring - Part 3 - AOP
PawanMM
 
PPTX
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
PawanMM
 
PPTX
Session 43 - Spring - Part 1 - IoC DI Beans
PawanMM
 
PPTX
Session 42 - Struts 2 Hibernate Integration
PawanMM
 
PPTX
Session 41 - Struts 2 Introduction
PawanMM
 
PPTX
Session 40 - Hibernate - Part 2
PawanMM
 
PPTX
Session 39 - Hibernate - Part 1
PawanMM
 
PPTX
Session 37 - JSP - Part 2 (final)
PawanMM
 
PPTX
Session 36 - JSP - Part 1
PawanMM
 
PPTX
Session 35 - Design Patterns
PawanMM
 
PPTX
Session 34 - JDBC Best Practices, Introduction to Design Patterns
PawanMM
 
PPTX
Session 33 - Session Management using other Techniques
PawanMM
 
PPTX
Session 32 - Session Management using Cookies
PawanMM
 
PPTX
Session 31 - Session Management, Best Practices, Design Patterns in Web Apps
PawanMM
 
PPTX
Session 30 - Servlets - Part 6
PawanMM
 
PPTX
Session 29 - Servlets - Part 5
PawanMM
 
PPTX
Session 28 - Servlets - Part 4
PawanMM
 
PPTX
Session 26 - Servlets Part 2
PawanMM
 
Session 48 - JS, JSON and AJAX
PawanMM
 
Session 46 - Spring - Part 4 - Spring MVC
PawanMM
 
Session 45 - Spring - Part 3 - AOP
PawanMM
 
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
PawanMM
 
Session 43 - Spring - Part 1 - IoC DI Beans
PawanMM
 
Session 42 - Struts 2 Hibernate Integration
PawanMM
 
Session 41 - Struts 2 Introduction
PawanMM
 
Session 40 - Hibernate - Part 2
PawanMM
 
Session 39 - Hibernate - Part 1
PawanMM
 
Session 37 - JSP - Part 2 (final)
PawanMM
 
Session 36 - JSP - Part 1
PawanMM
 
Session 35 - Design Patterns
PawanMM
 
Session 34 - JDBC Best Practices, Introduction to Design Patterns
PawanMM
 
Session 33 - Session Management using other Techniques
PawanMM
 
Session 32 - Session Management using Cookies
PawanMM
 
Session 31 - Session Management, Best Practices, Design Patterns in Web Apps
PawanMM
 
Session 30 - Servlets - Part 6
PawanMM
 
Session 29 - Servlets - Part 5
PawanMM
 
Session 28 - Servlets - Part 4
PawanMM
 
Session 26 - Servlets Part 2
PawanMM
 

Recently uploaded (20)

PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 

Session 19 - Review Session