SlideShare a Scribd company logo
ORACLE CERTIFIED JAVA PROGRAMMER - LEVEL 2
Sayed Ahmed
Computer Engineering, BUET, Bangladesh
Masters from the University of Manitoba, Canada
http://www.justetc.net
http://sayed.justetc.net
sayed@justetc.net
TOPICS
Java Class Design
Advanced Class Design
Object-Oriented Design Principles
Generics and Collections
String Processing
Exceptions and Assertions
Java I/O Fundamentals
Java File I/O (NIO.2)
Building Database Applications with JDBC
Threads
Concurrency
Localization
TOPICS IN DETAIL
 http://www.javainmind.com/exam2-
table/exam2-checklist/
INHERITANCE VS INTERFACE VS ABSTRACT CLASS
 http://stackoverflow.com/questions/5816563/when-should-i-
choose-inheritance-over-an-interface-when-designing-c-sharp-
class
 Their general recommendations are as follows:
 Do favor defining classes over interfaces.
 Do use abstract classes instead of interfaces to decouple the
contract from implementations. Abstract classes, if defined correctly,
allow for the same degree of decoupling between contract and
implementation.
 Do define an interface if you need to provide a polymorphic hierarchy
of value types.
 Consider defining interfaces to achieve a similar effect to that of
multiple inheritance.
 Chris Anderson expresses particular agreement with this last tenant, arguing
that:
 Abstract types do version much better, and allow for future extensibility, but they also
burn your one and only base type. Interfaces are appropriate when you are really
defining a contract between two objects that is invariant over time. Abstract base types
are better for defining a common base for a family of types.
INHERITANCE VS INTERFACE VS ABSTRACT CLASS
 http://stackoverflow.com/questions/3311788/when-to-implement-an-
interface-and-when-to-extend-a-superclass
 Use an interface if you want to define a contract. I.e. X must take Y
and return Z. It doesn't care how the code is doing that. A class can
implement multiple interfaces.
 Use an abstract class if you want to define default behaviour in non-
abstract methods so that the endusers can reuse it without rewriting it
again and again. A class can extend from only one other class. An
abstract class with only abstract methods can be as good definied as an
interface. An abstract class without any abstract method is
recognizeable as the Template Method pattern (see this answer for
some real world examples).
 An abstract class in turn can perfectly implement an interface whenever
you want to provide the enduser freedom in defining the default
behaviour.
JAVA INTERFACES
 http://docs.oracle.com/javase/tutorial/java/Ian
dI/createinterface.html
DEVELOP CODE THAT IMPLEMENTS "IS-A" AND/OR "HAS-A" RELATIONSHIPS
 http://www.javacamp.org/moreclasses/oop/o
op5.html
 http://www.primeinspiration.com/more/progra
mming/programming-guides/892-is-a-and-
has-a-relationships.html
OBJECT COMPOSITION
 http://stackoverflow.com/questions/3979581/
disadvantage-of-object-composition-over-
class-inheritance
 http://en.wikipedia.org/wiki/Composition_over
_inheritance
OOP DESIGN PRINCIPLES
 http://userpages.umbc.edu/~tarr/dp/lectures/
OOPrinciples.pdf
DESIGN A CLASS USING THE SINGLETON DESIGN
PATTERN.
 http://www.javaworld.com/javaworld/jw-04-
2003/jw-0425-designpatterns.html?page=2
 http://en.wikipedia.org/wiki/Singleton_pattern
 http://en.wikipedia.org/wiki/Singleton_pattern
 http://www.vogella.com/articles/DesignPatter
nSingleton/article.html
WRITE CODE TO IMPLEMENT THE DAO PATTERN
 http://www.oracle.com/technetwork/java/dataacc
essobject-138824.html
 Use a Data Access Object (DAO) to abstract and
encapsulate all access to the data source. The
DAO manages the connection with the data
source to obtain and store data.
 http://java.boot.by/ocpjp7-upgrade/ch02s03.html
 http://www.oracle.com/technetwork/java/dataacc
essobject-138824.html
 http://www.oracle.com/technetwork/java/dataacc
essobject-138824.html
ABSTRACT FACTORY METHOD
 http://stackoverflow.com/questions/5739611/diff
erences-between-abstract-factory-pattern-and-
factory-method
 The main difference between a "factory method" and
an "abstract factory" is that the factory method is a
single method, and an abstract factory is an object
 there is an object A, who wants to make a Foo
object. Instead of making the Foo object itself (e.g.
with a factory method), it's going get a different
object (the abstract factory) to create the Foo object.
 http://en.wikipedia.org/wiki/Abstract_factory_patt
ern

More Related Content

What's hot

Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8
MISSIASABTAL1
 
Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007
Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007
Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007
Arun Kumar
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questionsjbashask
 
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
ravi tyagi
 
DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...
DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...
DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...
DevLabs Alliance
 
Java interview question
Java interview questionJava interview question
Java interview question
varatharajanrajeswar
 
What's in a Name?
What's in a Name?What's in a Name?
What's in a Name?
Kevlin Henney
 
Dev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdetDev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdet
DevLabs Alliance
 
Exceptional Naming
Exceptional NamingExceptional Naming
Exceptional Naming
Kevlin Henney
 
25 java tough interview questions
25 java tough interview questions25 java tough interview questions
25 java tough interview questions
Arun Banotra
 
Java j2ee interview_questions
Java j2ee interview_questionsJava j2ee interview_questions
Java j2ee interview_questionsppratik86
 
Technical interview questions
Technical interview questionsTechnical interview questions
Technical interview questions
Soba Arjun
 
Java design pattern tutorial
Java design pattern tutorialJava design pattern tutorial
Java design pattern tutorial
Ashoka Vanjare
 
Introduction to Loops in Java | For, While, Do While, Infinite Loops | Edureka
Introduction to Loops in Java | For, While, Do While, Infinite Loops | EdurekaIntroduction to Loops in Java | For, While, Do While, Infinite Loops | Edureka
Introduction to Loops in Java | For, While, Do While, Infinite Loops | Edureka
Edureka!
 
Top 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDETTop 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDET
DevLabs Alliance
 
Top 10 Java Interview Questions and Answers 2014
Top 10 Java Interview Questions and Answers 2014 Top 10 Java Interview Questions and Answers 2014
Top 10 Java Interview Questions and Answers 2014
iimjobs and hirist
 
Java Training in Chennai - Payilagam Syllabus
Java Training in Chennai - Payilagam SyllabusJava Training in Chennai - Payilagam Syllabus
Java Training in Chennai - Payilagam Syllabus
Payilagam Software Training institute
 
Design pattern application
Design pattern applicationDesign pattern application
Design pattern application
gayatri thakur
 
Top 20 cucumber interview questions for sdet
Top 20 cucumber interview questions for sdetTop 20 cucumber interview questions for sdet
Top 20 cucumber interview questions for sdet
DevLabs Alliance
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
TIB Academy
 

What's hot (20)

Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8
 
Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007
Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007
Lulu.com.java.j2 ee.job.interview.companion.2nd.edition.apr.2007
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questions
 
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
 
DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...
DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...
DevLabs Alliance Top 20 Software Testing Interview Questions for SDET - by De...
 
Java interview question
Java interview questionJava interview question
Java interview question
 
What's in a Name?
What's in a Name?What's in a Name?
What's in a Name?
 
Dev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdetDev labs alliance top 20 basic java interview questions for sdet
Dev labs alliance top 20 basic java interview questions for sdet
 
Exceptional Naming
Exceptional NamingExceptional Naming
Exceptional Naming
 
25 java tough interview questions
25 java tough interview questions25 java tough interview questions
25 java tough interview questions
 
Java j2ee interview_questions
Java j2ee interview_questionsJava j2ee interview_questions
Java j2ee interview_questions
 
Technical interview questions
Technical interview questionsTechnical interview questions
Technical interview questions
 
Java design pattern tutorial
Java design pattern tutorialJava design pattern tutorial
Java design pattern tutorial
 
Introduction to Loops in Java | For, While, Do While, Infinite Loops | Edureka
Introduction to Loops in Java | For, While, Do While, Infinite Loops | EdurekaIntroduction to Loops in Java | For, While, Do While, Infinite Loops | Edureka
Introduction to Loops in Java | For, While, Do While, Infinite Loops | Edureka
 
Top 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDETTop 20 basic java interview questions for SDET
Top 20 basic java interview questions for SDET
 
Top 10 Java Interview Questions and Answers 2014
Top 10 Java Interview Questions and Answers 2014 Top 10 Java Interview Questions and Answers 2014
Top 10 Java Interview Questions and Answers 2014
 
Java Training in Chennai - Payilagam Syllabus
Java Training in Chennai - Payilagam SyllabusJava Training in Chennai - Payilagam Syllabus
Java Training in Chennai - Payilagam Syllabus
 
Design pattern application
Design pattern applicationDesign pattern application
Design pattern application
 
Top 20 cucumber interview questions for sdet
Top 20 cucumber interview questions for sdetTop 20 cucumber interview questions for sdet
Top 20 cucumber interview questions for sdet
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
 

Similar to Java ocjp level_2

20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
Gradeup
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
Kuntal Bhowmick
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using ReflectionGanesh Samarthyam
 
Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro
anshu_atri
 
Design patterns
Design patternsDesign patterns
Design patterns
Akhilesh Joshi
 
159747608 a-training-report-on
159747608 a-training-report-on159747608 a-training-report-on
159747608 a-training-report-on
homeworkping7
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
vmadan89
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
G C Reddy Technologies
 
Professional-core-java-training
Professional-core-java-trainingProfessional-core-java-training
Professional-core-java-training
Vibrant Technologies & Computers
 
java_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdfjava_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdf
akankshasorate1
 
Java bcs 21_vision academy_final
Java bcs 21_vision academy_finalJava bcs 21_vision academy_final
Java bcs 21_vision academy_final
VisionAcademyClasses
 
Top 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedTop 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedGaurav Maheshwari
 
Java Faqs useful for freshers and experienced
Java Faqs useful for freshers and experiencedJava Faqs useful for freshers and experienced
Java Faqs useful for freshers and experiencedyearninginjava
 
SMI - Introduction to Java
SMI - Introduction to JavaSMI - Introduction to Java
SMI - Introduction to Java
SMIJava
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
Krishnaov
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
Rich Helton
 
JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O
Jyothishmathi Institute of Technology and Science Karimnagar
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in java
smumbahelp
 
Core Java Learning Path
Core Java Learning PathCore Java Learning Path
Core Java Learning Path
SkillPracticalEdTech
 

Similar to Java ocjp level_2 (20)

20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
 
Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro
 
Design patterns
Design patternsDesign patterns
Design patterns
 
159747608 a-training-report-on
159747608 a-training-report-on159747608 a-training-report-on
159747608 a-training-report-on
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Professional-core-java-training
Professional-core-java-trainingProfessional-core-java-training
Professional-core-java-training
 
java_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdfjava_bba_21_vision academy_final.pdf
java_bba_21_vision academy_final.pdf
 
Java bcs 21_vision academy_final
Java bcs 21_vision academy_finalJava bcs 21_vision academy_final
Java bcs 21_vision academy_final
 
Top 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedTop 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experienced
 
Java Faqs useful for freshers and experienced
Java Faqs useful for freshers and experiencedJava Faqs useful for freshers and experienced
Java Faqs useful for freshers and experienced
 
SMI - Introduction to Java
SMI - Introduction to JavaSMI - Introduction to Java
SMI - Introduction to Java
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
 
Java scjp-part1
Java scjp-part1Java scjp-part1
Java scjp-part1
 
JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in java
 
Core Java Learning Path
Core Java Learning PathCore Java Learning Path
Core Java Learning Path
 

More from Sayed Ahmed

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and Ethics
Sayed Ahmed
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commands
Sayed Ahmed
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework
Sayed Ahmed
 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodev
Sayed Ahmed
 
Invest wisely
Invest wiselyInvest wisely
Invest wisely
Sayed Ahmed
 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction to
Sayed Ahmed
 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overview
Sayed Ahmed
 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend framework
Sayed Ahmed
 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3
Sayed Ahmed
 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2
Sayed Ahmed
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
Sayed Ahmed
 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcuts
Sayed Ahmed
 
Virtualization
VirtualizationVirtualization
Virtualization
Sayed Ahmed
 
User interfaces
User interfacesUser interfaces
User interfaces
Sayed Ahmed
 
Unreal
UnrealUnreal
Unreal
Sayed Ahmed
 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfony
Sayed Ahmed
 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayed
Sayed Ahmed
 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_design
Sayed Ahmed
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
Sayed Ahmed
 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrative
Sayed Ahmed
 

More from Sayed Ahmed (20)

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and Ethics
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commands
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework
 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodev
 
Invest wisely
Invest wiselyInvest wisely
Invest wisely
 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction to
 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overview
 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend framework
 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3
 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcuts
 
Virtualization
VirtualizationVirtualization
Virtualization
 
User interfaces
User interfacesUser interfaces
User interfaces
 
Unreal
UnrealUnreal
Unreal
 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfony
 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayed
 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_design
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrative
 

Recently uploaded

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 

Recently uploaded (20)

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 

Java ocjp level_2

  • 1. ORACLE CERTIFIED JAVA PROGRAMMER - LEVEL 2 Sayed Ahmed Computer Engineering, BUET, Bangladesh Masters from the University of Manitoba, Canada http://www.justetc.net http://sayed.justetc.net sayed@justetc.net
  • 2. TOPICS Java Class Design Advanced Class Design Object-Oriented Design Principles Generics and Collections String Processing Exceptions and Assertions Java I/O Fundamentals Java File I/O (NIO.2) Building Database Applications with JDBC Threads Concurrency Localization
  • 3. TOPICS IN DETAIL  http://www.javainmind.com/exam2- table/exam2-checklist/
  • 4. INHERITANCE VS INTERFACE VS ABSTRACT CLASS  http://stackoverflow.com/questions/5816563/when-should-i- choose-inheritance-over-an-interface-when-designing-c-sharp- class  Their general recommendations are as follows:  Do favor defining classes over interfaces.  Do use abstract classes instead of interfaces to decouple the contract from implementations. Abstract classes, if defined correctly, allow for the same degree of decoupling between contract and implementation.  Do define an interface if you need to provide a polymorphic hierarchy of value types.  Consider defining interfaces to achieve a similar effect to that of multiple inheritance.  Chris Anderson expresses particular agreement with this last tenant, arguing that:  Abstract types do version much better, and allow for future extensibility, but they also burn your one and only base type. Interfaces are appropriate when you are really defining a contract between two objects that is invariant over time. Abstract base types are better for defining a common base for a family of types.
  • 5. INHERITANCE VS INTERFACE VS ABSTRACT CLASS  http://stackoverflow.com/questions/3311788/when-to-implement-an- interface-and-when-to-extend-a-superclass  Use an interface if you want to define a contract. I.e. X must take Y and return Z. It doesn't care how the code is doing that. A class can implement multiple interfaces.  Use an abstract class if you want to define default behaviour in non- abstract methods so that the endusers can reuse it without rewriting it again and again. A class can extend from only one other class. An abstract class with only abstract methods can be as good definied as an interface. An abstract class without any abstract method is recognizeable as the Template Method pattern (see this answer for some real world examples).  An abstract class in turn can perfectly implement an interface whenever you want to provide the enduser freedom in defining the default behaviour.
  • 7. DEVELOP CODE THAT IMPLEMENTS "IS-A" AND/OR "HAS-A" RELATIONSHIPS  http://www.javacamp.org/moreclasses/oop/o op5.html  http://www.primeinspiration.com/more/progra mming/programming-guides/892-is-a-and- has-a-relationships.html
  • 9. OOP DESIGN PRINCIPLES  http://userpages.umbc.edu/~tarr/dp/lectures/ OOPrinciples.pdf
  • 10. DESIGN A CLASS USING THE SINGLETON DESIGN PATTERN.  http://www.javaworld.com/javaworld/jw-04- 2003/jw-0425-designpatterns.html?page=2  http://en.wikipedia.org/wiki/Singleton_pattern  http://en.wikipedia.org/wiki/Singleton_pattern  http://www.vogella.com/articles/DesignPatter nSingleton/article.html
  • 11. WRITE CODE TO IMPLEMENT THE DAO PATTERN  http://www.oracle.com/technetwork/java/dataacc essobject-138824.html  Use a Data Access Object (DAO) to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data.  http://java.boot.by/ocpjp7-upgrade/ch02s03.html  http://www.oracle.com/technetwork/java/dataacc essobject-138824.html  http://www.oracle.com/technetwork/java/dataacc essobject-138824.html
  • 12. ABSTRACT FACTORY METHOD  http://stackoverflow.com/questions/5739611/diff erences-between-abstract-factory-pattern-and- factory-method  The main difference between a "factory method" and an "abstract factory" is that the factory method is a single method, and an abstract factory is an object  there is an object A, who wants to make a Foo object. Instead of making the Foo object itself (e.g. with a factory method), it's going get a different object (the abstract factory) to create the Foo object.  http://en.wikipedia.org/wiki/Abstract_factory_patt ern