SlideShare a Scribd company logo
1 of 24
P.1
String
ghadeer-al-hasan ghadeer.al.hasan.95@gmail.com
Java String P.2
 Is an object that represents a sequence of character.
 String class is used to create string object.
There are two ways to create String object:
1) string literal.
2) new keyword
P.S: String object are stored in
a special memory area know as string
constant pool.
We used it, to make Java more memory efficient (because no new object
Are created if it exists already in string constant pool).
Java String Cont. : P.3
JVM will create a new string object
in normal(non pool) heap memory
Java String Compare : P.4
Java String Compare Cont. : P.5
Java String Concat : P.6
After a string literal, all the + will be treated as
string concatenation operator
Java String Substring : P.7
Java String Method : P.8
StringBuffer class: P.9
 Is used to created mutable string.
 The StringBuffer class in java same as String class except it is mutable.
 It can be changed.
StringBuffer class Cont. : P.10
toString() method: P.11
 If you to represent any object as a string,
 Returns the string representation of the object.
 Java compiler internally invoked the toString() method on the object when you print it.
 By override the toString() method of the Object class, we can return values of the object.
toString() method Cont. : P.12
P.13
Inner Class
Inner Class : P.14
 Inner class or nested class is a class declared inside the class or interface.
 It can access all the members (data members and methods) of outer class
including private.
 Are used to develop more readable and maintainable code
 Code optimization: it requires less code to write.
Inner class is a part of nested class. Not-static nested classes are know as inner class.
There are two types:
1. Non-static nested class( inner class)
a. member inner class.
b. anonymous inner class.
c. local inner class
2. Static nested class.
Member inner class: P.15
 Is a non-static class that is created inside a class but outside a method.
The java compiler created two class files in case of inner class. If you want to
Instantiate inner class, you must have to create the instance of outer class,
Anonymous inner class P.16
 Is A class that have no name .
 It should be used if you have to override method of class of interface.
Local inner class: P.17
 Is a class created inside a method.
 If you want to invoke the method of local inner class, you must instantiate this
class inside the method.
• Local variable can’t be private,
public or protected.
• Local inner class cannot be
invoked from outside the method.
Local inner class: P.18
• Local inner class cannot access non-final local variable till JDK 1.7.
• Since JDK 1.8, it is possible access to access the non-final local variable in it.
Local inner class P.19
 Is a class created inside a method.
 If you want to invoke the method of local inner class, you must instantiate this
class inside the method.
• Local variable can’t be private,
public or protected.
• Local inner class cannot be
invoked from outside the method.
Static nested class: P.20
 It cannot access non-static data members and methods.
 It can be accessed by outer class name.
• It can access static data members
of outer class including private.
Static nested class Cont. : P.21
Nested Interface
P.22
Nested Interface: P.23
 Is declared within another interface or class.
 It used to group related interfaces.
 It can be easy to maintain.
 It must be public if it is declared inside the interface.
 But it can have any access modifier if declared within the class.
 It is declared static implicitly.
Nested Interface Cont. : P.24

More Related Content

What's hot

What's hot (20)

Lecture 8 Library classes
Lecture 8 Library classesLecture 8 Library classes
Lecture 8 Library classes
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Lecture 4. mte 407
Lecture 4. mte 407Lecture 4. mte 407
Lecture 4. mte 407
 
Structure of java program diff c- cpp and java
Structure of java program  diff c- cpp and javaStructure of java program  diff c- cpp and java
Structure of java program diff c- cpp and java
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
 
Oop
OopOop
Oop
 
Access specifiers (Public Private Protected) C++
Access specifiers (Public Private  Protected) C++Access specifiers (Public Private  Protected) C++
Access specifiers (Public Private Protected) C++
 
Basics of Java
Basics of JavaBasics of Java
Basics of Java
 
Friend Function
Friend FunctionFriend Function
Friend Function
 
Java Data Types and Variables
Java Data Types and VariablesJava Data Types and Variables
Java Data Types and Variables
 
Inner Classes
Inner ClassesInner Classes
Inner Classes
 
Inner classes in java
Inner classes in javaInner classes in java
Inner classes in java
 
#6- Arrays and Collections Framework
#6- Arrays and Collections Framework#6- Arrays and Collections Framework
#6- Arrays and Collections Framework
 
Java basic data types
Java basic data typesJava basic data types
Java basic data types
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
 
Learn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexusLearn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexus
 
Ballerina philosophy
Ballerina philosophy Ballerina philosophy
Ballerina philosophy
 
Friend function OOPC
Friend function OOPCFriend function OOPC
Friend function OOPC
 
Java interfaces
Java   interfacesJava   interfaces
Java interfaces
 
Java Datatypes
Java DatatypesJava Datatypes
Java Datatypes
 

Similar to [Java] #8 String and Inner Class

ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdfch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdfbca23189c
 
A1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.pptA1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.pptRithwikRanjan
 
Classes-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdfClasses-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdfismartshanker1
 
Python_Unit_3.pdf
Python_Unit_3.pdfPython_Unit_3.pdf
Python_Unit_3.pdfalaparthi
 
+2 CS class and objects
+2 CS class and objects+2 CS class and objects
+2 CS class and objectskhaliledapal
 
Nested classes in java
Nested classes in javaNested classes in java
Nested classes in javaRicha Singh
 
classandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.pptclassandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.pptmanomkpsg
 
Lecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptxLecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptxrayanbabur
 
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxDaveEstonilo
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdfvenud11
 

Similar to [Java] #8 String and Inner Class (20)

Inner Classes in Java
Inner Classes in JavaInner Classes in Java
Inner Classes in Java
 
Inner class
Inner classInner class
Inner class
 
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdfch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
 
A1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.pptA1771937735_21789_14_2018__16_ Nested Classes.ppt
A1771937735_21789_14_2018__16_ Nested Classes.ppt
 
Java- Nested Classes
Java- Nested ClassesJava- Nested Classes
Java- Nested Classes
 
Classes-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdfClasses-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdf
 
Python_Unit_3.pdf
Python_Unit_3.pdfPython_Unit_3.pdf
Python_Unit_3.pdf
 
java basic .pdf
java basic .pdfjava basic .pdf
java basic .pdf
 
+2 CS class and objects
+2 CS class and objects+2 CS class and objects
+2 CS class and objects
 
Nested classes in java
Nested classes in javaNested classes in java
Nested classes in java
 
classandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.pptclassandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.ppt
 
Lecture22.23.07.2014
Lecture22.23.07.2014Lecture22.23.07.2014
Lecture22.23.07.2014
 
Unit3
Unit3Unit3
Unit3
 
Lecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptxLecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptx
 
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptx
 
inheritance
inheritanceinheritance
inheritance
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdf
 
CHAPTER 3 part1.pdf
CHAPTER 3 part1.pdfCHAPTER 3 part1.pdf
CHAPTER 3 part1.pdf
 
Class and object
Class and objectClass and object
Class and object
 
4 Classes & Objects
4 Classes & Objects4 Classes & Objects
4 Classes & Objects
 

More from Ghadeer AlHasan

More from Ghadeer AlHasan (20)

[C++ Tutorial ] #9 Classes
[C++ Tutorial ] #9 Classes[C++ Tutorial ] #9 Classes
[C++ Tutorial ] #9 Classes
 
[C++ Tutorial] #8 Files
[C++ Tutorial] #8 Files[C++ Tutorial] #8 Files
[C++ Tutorial] #8 Files
 
[C++ Tutorial] #7- Linked List
[C++ Tutorial] #7- Linked List[C++ Tutorial] #7- Linked List
[C++ Tutorial] #7- Linked List
 
[C++ Tutorial] #6- Pointers
[C++ Tutorial] #6- Pointers [C++ Tutorial] #6- Pointers
[C++ Tutorial] #6- Pointers
 
[Java] #7 - Input & Output Stream
[Java] #7 - Input & Output Stream[Java] #7 - Input & Output Stream
[Java] #7 - Input & Output Stream
 
[C++] #5 - Structures
[C++] #5 - Structures[C++] #5 - Structures
[C++] #5 - Structures
 
3- Operators in Java
3- Operators in Java3- Operators in Java
3- Operators in Java
 
1- Introduction to java
1- Introduction to java1- Introduction to java
1- Introduction to java
 
0- Overview
0- Overview0- Overview
0- Overview
 
4- Arrays
4-  Arrays4-  Arrays
4- Arrays
 
3- Functions
3-  Functions3-  Functions
3- Functions
 
2- Control Structures
2-  Control Structures2-  Control Structures
2- Control Structures
 
1- Languages Basics
1- Languages Basics1- Languages Basics
1- Languages Basics
 
#8 (Java Message Service)
#8 (Java Message Service)#8 (Java Message Service)
#8 (Java Message Service)
 
#7 (Java Message Service)
#7 (Java Message Service)#7 (Java Message Service)
#7 (Java Message Service)
 
#6 (RESTtful Web Wervices)
#6 (RESTtful Web Wervices)#6 (RESTtful Web Wervices)
#6 (RESTtful Web Wervices)
 
#5 (Remote Method Invocation)
#5 (Remote Method Invocation)#5 (Remote Method Invocation)
#5 (Remote Method Invocation)
 
#4 (Remote Method Invocation)
#4 (Remote Method Invocation)#4 (Remote Method Invocation)
#4 (Remote Method Invocation)
 
#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)
 
#2 (UDP)
#2 (UDP)#2 (UDP)
#2 (UDP)
 

Recently uploaded

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Recently uploaded (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

[Java] #8 String and Inner Class

  • 2. Java String P.2  Is an object that represents a sequence of character.  String class is used to create string object. There are two ways to create String object: 1) string literal. 2) new keyword P.S: String object are stored in a special memory area know as string constant pool. We used it, to make Java more memory efficient (because no new object Are created if it exists already in string constant pool).
  • 3. Java String Cont. : P.3 JVM will create a new string object in normal(non pool) heap memory
  • 5. Java String Compare Cont. : P.5
  • 6. Java String Concat : P.6 After a string literal, all the + will be treated as string concatenation operator
  • 9. StringBuffer class: P.9  Is used to created mutable string.  The StringBuffer class in java same as String class except it is mutable.  It can be changed.
  • 11. toString() method: P.11  If you to represent any object as a string,  Returns the string representation of the object.  Java compiler internally invoked the toString() method on the object when you print it.  By override the toString() method of the Object class, we can return values of the object.
  • 14. Inner Class : P.14  Inner class or nested class is a class declared inside the class or interface.  It can access all the members (data members and methods) of outer class including private.  Are used to develop more readable and maintainable code  Code optimization: it requires less code to write. Inner class is a part of nested class. Not-static nested classes are know as inner class. There are two types: 1. Non-static nested class( inner class) a. member inner class. b. anonymous inner class. c. local inner class 2. Static nested class.
  • 15. Member inner class: P.15  Is a non-static class that is created inside a class but outside a method. The java compiler created two class files in case of inner class. If you want to Instantiate inner class, you must have to create the instance of outer class,
  • 16. Anonymous inner class P.16  Is A class that have no name .  It should be used if you have to override method of class of interface.
  • 17. Local inner class: P.17  Is a class created inside a method.  If you want to invoke the method of local inner class, you must instantiate this class inside the method. • Local variable can’t be private, public or protected. • Local inner class cannot be invoked from outside the method.
  • 18. Local inner class: P.18 • Local inner class cannot access non-final local variable till JDK 1.7. • Since JDK 1.8, it is possible access to access the non-final local variable in it.
  • 19. Local inner class P.19  Is a class created inside a method.  If you want to invoke the method of local inner class, you must instantiate this class inside the method. • Local variable can’t be private, public or protected. • Local inner class cannot be invoked from outside the method.
  • 20. Static nested class: P.20  It cannot access non-static data members and methods.  It can be accessed by outer class name. • It can access static data members of outer class including private.
  • 21. Static nested class Cont. : P.21
  • 23. Nested Interface: P.23  Is declared within another interface or class.  It used to group related interfaces.  It can be easy to maintain.  It must be public if it is declared inside the interface.  But it can have any access modifier if declared within the class.  It is declared static implicitly.