SlideShare a Scribd company logo
Packages
&
Interfaces
Presented by: Anindita Mandal
Amar Kr Soni
Alekhya Pandey
Akashdeep Singha Roy
Akash Das
Akansha Kumari
Aishik Das
What are ‘Packages’
in JAVA?A Package can be defined as a grouping of related types (classes, interfaces, enumerations and annotations )
providing access protection and namespace management.
It can be further categorized in two
types:
• We were storing all the coded files inside the same directory, what if, someday we need to
make a project?
• As the applications grows it becomes difficult to keep all the files in same directory, also we need to
ensure that the name we choose should be unique. To address this problem java introduces a mechanism
to manage all the classes this is called Packages
 What does it mean
actually?
• Let’s see…
Directory Structure showing the inbuilt
packages
• Now, the inbuilt packages will be available to user with all use cases, but what if we need to do
something which is not pre-defined?
• We’ll be creating our own packages.
• Lets see how!
By default I wrote all files here inside this directory.
Now if I’ve to create a package.
Firstly, creating a new directory
Creating new files inside the
directory
Now, the package
name should be the
same as directory
name
• Now, if we want to access the
package
Test.*;
Represents all files
inside the Test directory
On running this, we get
Inside Test, class sample
is present.
By this we can observe that the package is properly imported.
What are ‘Interfaces’ in
JAVA?• An interface in java is a blueprint of a class.
• It has static constants and abstract methods.
• The interface in java is a mechanism to achieve abstraction.
Just like a class can inherit or extend from another class, similarly the interface can inherit or extend from another interface
 How do we declare an
interface?• Let’s see the syntax for writing an interface…
• An interface is implicitly abstract.
• So not need to use the abstract keyword while declaring an interface.
• Each Fields in an interface is also implicitly static and final, so the static and final keyword is
not needed (Refer below diagram).
• Methods in an interface are also implicitly public.
Creating an interface
Implementing the interface
Completing the body of
the abstract method
After running the program
Interface helps us getting an implementation of
multi-parent inheritance which is not there in JAVA
References
 https://www.javatpoint.com/package
 https://www.tutorialspoint.com/java/java_packages.htm
 https://www.geeksforgeeks.org/packages-in-java/
 https://docs.oracle.com/javase/tutorial/java/concepts/package.html
 https://www.geeksforgeeks.org/interfaces-in-java/
 https://www.javatpoint.com/interface-in-java
 https://www.tutorialspoint.com/java/java_interfaces.htm
Thank You
“I am enough of an artist to draw freely upon my imagination.
Imagination is more important than knowledge.
Knowledge is limited.
Imagination encircles the world.”
― AlbertEinstein
Now, thought for the day,

More Related Content

PPTX
Packages and interfaces
PDF
JAVA PROGRAMMING – Packages - Stream based I/O
PDF
Java packages
DOCX
Class notes(week 7) on packages
PPT
Packages in java
PPTX
Pi j4.1 packages
PPTX
Unit3 part3-packages and interfaces
PDF
Java - Interfaces & Packages
Packages and interfaces
JAVA PROGRAMMING – Packages - Stream based I/O
Java packages
Class notes(week 7) on packages
Packages in java
Pi j4.1 packages
Unit3 part3-packages and interfaces
Java - Interfaces & Packages

What's hot (20)

PPTX
Introduction to java
PPTX
Unit 5 java-awt (1)
PPTX
OCA JAVA - 1 Packages and Class Structure
PPTX
Unit3 packages & interfaces
PPTX
java interface and packages
PPTX
Inner classes in java
PPTX
Structure of java program diff c- cpp and java
PPT
packages and interfaces
PPTX
Object oriented programming in java
PPT
Packages in java
PPTX
Java package
PDF
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
PPTX
5.interface and packages
PPTX
C# classes objects
PDF
Packages
PDF
Java programming -Object-Oriented Thinking- Inheritance
PPTX
Packages in java
PPT
Java access modifiers
PPSX
Java Object Oriented Programming
PDF
Oops concepts || Object Oriented Programming Concepts in Java
Introduction to java
Unit 5 java-awt (1)
OCA JAVA - 1 Packages and Class Structure
Unit3 packages & interfaces
java interface and packages
Inner classes in java
Structure of java program diff c- cpp and java
packages and interfaces
Object oriented programming in java
Packages in java
Java package
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
5.interface and packages
C# classes objects
Packages
Java programming -Object-Oriented Thinking- Inheritance
Packages in java
Java access modifiers
Java Object Oriented Programming
Oops concepts || Object Oriented Programming Concepts in Java
Ad

Similar to Packages and Interfaces (20)

PPT
Packages,interfaces and exceptions
PPTX
Objects and classes in OO Programming concepts
PPTX
Chap1 packages
PPTX
OBJECT ORIENTED PROGRAMMING Unit2 second half.pptx
PPTX
Z blue interfaces and packages (37129912)
PDF
Unit 2 notes.pdf
PPTX
Interface &packages
PPTX
Unit II Inheritance ,Interface and Packages.pptx
PPT
Unit 4 Java
PPT
Packages and interfaces
PPT
7.Packages and Interfaces(MB).ppt .
DOCX
Unit4 java
PPT
Packages in java
PPTX
Packages in java
PDF
Java - Packages Concepts
PPTX
Packages and interfaces
PPTX
10-Lecture10_Leeeeeeeeeeeeeeeecture.pptx
PPTX
Lecture 19
PPT
Lec8_Java Advanced class features_Part 1V.ppt
PPTX
java package java package in java packages
Packages,interfaces and exceptions
Objects and classes in OO Programming concepts
Chap1 packages
OBJECT ORIENTED PROGRAMMING Unit2 second half.pptx
Z blue interfaces and packages (37129912)
Unit 2 notes.pdf
Interface &packages
Unit II Inheritance ,Interface and Packages.pptx
Unit 4 Java
Packages and interfaces
7.Packages and Interfaces(MB).ppt .
Unit4 java
Packages in java
Packages in java
Java - Packages Concepts
Packages and interfaces
10-Lecture10_Leeeeeeeeeeeeeeeecture.pptx
Lecture 19
Lec8_Java Advanced class features_Part 1V.ppt
java package java package in java packages
Ad

Recently uploaded (20)

PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Nekopoi APK 2025 free lastest update
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Designing Intelligence for the Shop Floor.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Download FL Studio Crack Latest version 2025 ?
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Reimagine Home Health with the Power of Agentic AI​
Computer Software and OS of computer science of grade 11.pptx
Odoo Companies in India – Driving Business Transformation.pdf
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Patient Appointment Booking in Odoo with online payment
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Why Generative AI is the Future of Content, Code & Creativity?
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
iTop VPN Free 5.6.0.5262 Crack latest version 2025
17 Powerful Integrations Your Next-Gen MLM Software Needs
Nekopoi APK 2025 free lastest update
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
Complete Guide to Website Development in Malaysia for SMEs
wealthsignaloriginal-com-DS-text-... (1).pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design

Packages and Interfaces

  • 1. Packages & Interfaces Presented by: Anindita Mandal Amar Kr Soni Alekhya Pandey Akashdeep Singha Roy Akash Das Akansha Kumari Aishik Das
  • 2. What are ‘Packages’ in JAVA?A Package can be defined as a grouping of related types (classes, interfaces, enumerations and annotations ) providing access protection and namespace management. It can be further categorized in two types:
  • 3. • We were storing all the coded files inside the same directory, what if, someday we need to make a project? • As the applications grows it becomes difficult to keep all the files in same directory, also we need to ensure that the name we choose should be unique. To address this problem java introduces a mechanism to manage all the classes this is called Packages  What does it mean actually? • Let’s see… Directory Structure showing the inbuilt packages
  • 4. • Now, the inbuilt packages will be available to user with all use cases, but what if we need to do something which is not pre-defined? • We’ll be creating our own packages. • Lets see how! By default I wrote all files here inside this directory. Now if I’ve to create a package. Firstly, creating a new directory Creating new files inside the directory Now, the package name should be the same as directory name
  • 5. • Now, if we want to access the package Test.*; Represents all files inside the Test directory On running this, we get Inside Test, class sample is present. By this we can observe that the package is properly imported.
  • 6. What are ‘Interfaces’ in JAVA?• An interface in java is a blueprint of a class. • It has static constants and abstract methods. • The interface in java is a mechanism to achieve abstraction. Just like a class can inherit or extend from another class, similarly the interface can inherit or extend from another interface
  • 7.  How do we declare an interface?• Let’s see the syntax for writing an interface… • An interface is implicitly abstract. • So not need to use the abstract keyword while declaring an interface. • Each Fields in an interface is also implicitly static and final, so the static and final keyword is not needed (Refer below diagram). • Methods in an interface are also implicitly public.
  • 8. Creating an interface Implementing the interface Completing the body of the abstract method After running the program Interface helps us getting an implementation of multi-parent inheritance which is not there in JAVA
  • 9. References  https://www.javatpoint.com/package  https://www.tutorialspoint.com/java/java_packages.htm  https://www.geeksforgeeks.org/packages-in-java/  https://docs.oracle.com/javase/tutorial/java/concepts/package.html  https://www.geeksforgeeks.org/interfaces-in-java/  https://www.javatpoint.com/interface-in-java  https://www.tutorialspoint.com/java/java_interfaces.htm
  • 10. Thank You “I am enough of an artist to draw freely upon my imagination. Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.” ― AlbertEinstein Now, thought for the day,