SlideShare a Scribd company logo
1 of 16
Contents 
• Introduction of Inheritance 3 
• Classes classification 4 
 Super class 
 Intermediate class 
 Child class 
• Relation between classes 5 
• Super class 6 
• Intermediate class 7 
• Child class 8 
• Types of Inheritance 9 
 Single Inheritance 
 Multilevel Inheritance 
 Hierarchical Inheritance 
• Single Inheritance 10 
• Multilevel Inheritance 11 
• Hierarchical Inheritance 12 
• Indirect Mechanism of Inheritance 13 
• A program demonstrating inheritance 14 
• Limitations 15
INHERITANCE 
• One of the most effective features of Oop’s paradigm. 
• Establish a link/connectivity between 2 or more 
classes. 
• Permits sharing and accessing properties from one to 
another class. 
• to establish this relation Java uses ‘extends’ keyword.
Category of Classes on the Basis of 
Inheritance 
Super class 
(base/parent/driver/inheritance/ 
ancestor class). 
Intermediate class 
(mediating/dual class). 
Child class 
(sub/associate/derived/inherited class).
Relation between classes
Super class 
Top located class 
Service provider 
(its properties accessed by all its lower level 
class).
Intermediate class 
Middle located class 
Having Dual policy 
(obtain properties of upper level class 
and transmit properties to lower level 
class).
Child class 
Bottom located class 
much benefitted class 
much loaded class 
properties of child class as well as 
class and parent class can be accessed by 
only the object of child class.
TYPES of INHERITANCE 
• Single Inheritance 
• Multilevel Inheritance 
• Hierarchical Inheritance
Single Inheritance 
• A structure having one and only one parent as well 
as child class. 
• Child class is authorized to access the property of 
Parent class. Syntax :
Multilevel Inheritance 
• Standard structure of Single 
Inheritance having one Parent, 
one or more intermediate and 
one child classes. 
• Child class as well as intermediate 
class may access the properties of 
upper level classes. 
Syntax :
Hierarchical Inheritance 
A structure having one parent 
and more child class. 
Child classes must be connected 
with only Parent class. 
Syntax :
Java Supports a special feature called interface. 
This feature helps to connect a class with more 
than one classes. 
For this type of connectivity java uses ‘implements’ 
keyword. Syntax : 
interface A{ 
……..} 
Interface B { 
____} 
class M { 
-------} 
class N implements A,B extends M{ 
===== 
_____------…………}
A Program demonstrating Inheritance in 
Java 
import java.util.*; 
import java.io.*; 
interface Prn1{ 
void Bits(int x);} 
interface Prn2{ 
void Bytes();} 
class Prn3{ 
void Mega(){ 
int x=5,y,i=1; 
long z=1; 
while(i<=10){ 
y=x*i; 
i++; 
//System.out.println(y); 
z=z*y; } 
System.out.println("Product of Table of 5 : "+z);}} 
class RPT extends Prn3 implements Prn2{ 
int x,y,z; 
void Bits(int a){ 
if(a%3==0) 
System.out.println("nnn"+a+" is modulated by 3.nn"); 
else 
System.out.println("nnn"+a+" is not modulated by 3.nn");} 
public void Bytes(){ 
Scanner S=new Scanner(System.in); 
x=10; 
System.out.print("Enter a no. for a rectangle width : "); 
y=S.nextInt(); 
z=x*y; 
System.out.println("nnArea of rectangle : "+x+"x"+y+"="+z); 
System.out.println();}} 
class Intrfc{ 
public static void main(String[] Arg){ 
RPT obj=new RPT(); 
obj.Bits(16); 
obj.Bytes(); 
obj.Mega();}} 
Output : 
16 is not modulated by 3. 
Enter a no. for a rectangle width : 20 
Area of rectangle : 10x20=200 
Product of table of 5 : 35437500000000
• Link is establish into single direction(Fig). 
Java not support Multiple 
inheritance as well as 
Hybrid inheritance. 
The extends keyword permits 
to connect a class with only one class. 
In Interface, properties are only declared and assined, 
but n’ver defined.
THANK YOU

More Related Content

What's hot (20)

Inheritance
InheritanceInheritance
Inheritance
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
 
Interface in java
Interface in javaInterface in java
Interface in java
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Interface
InterfaceInterface
Interface
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Strings in Java
Strings in JavaStrings in Java
Strings in Java
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
class and objects
class and objectsclass and objects
class and objects
 
Applets in java
Applets in javaApplets in java
Applets in java
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Abstraction in java
Abstraction in javaAbstraction in java
Abstraction in java
 

Similar to Inheritance in JAVA PPT

Java presention Inheritance present By Showrov Ahamed
Java presention Inheritance present By Showrov AhamedJava presention Inheritance present By Showrov Ahamed
Java presention Inheritance present By Showrov AhamedMd Showrov Ahmed
 
Multiple inheritance in java3 (1).pptx
Multiple inheritance in java3 (1).pptxMultiple inheritance in java3 (1).pptx
Multiple inheritance in java3 (1).pptxRkGupta83
 
Inheritance in java
Inheritance in java Inheritance in java
Inheritance in java yash jain
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritanceteach4uin
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritanceteach4uin
 
INHERITANCE IN JAVA.pptx
INHERITANCE IN JAVA.pptxINHERITANCE IN JAVA.pptx
INHERITANCE IN JAVA.pptxNITHISG1
 
Multiple inheritance possible in Java
Multiple inheritance possible in JavaMultiple inheritance possible in Java
Multiple inheritance possible in JavaKurapati Vishwak
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsRaja Sekhar
 
SodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptx
SodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptxSodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptx
SodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptxRudranilDas11
 
OOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfOOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfAnant240318
 
Java for android developers
Java for android developersJava for android developers
Java for android developersAly Abdelkareem
 

Similar to Inheritance in JAVA PPT (20)

Java presention Inheritance present By Showrov Ahamed
Java presention Inheritance present By Showrov AhamedJava presention Inheritance present By Showrov Ahamed
Java presention Inheritance present By Showrov Ahamed
 
Inheritance
InheritanceInheritance
Inheritance
 
Multiple inheritance in java3 (1).pptx
Multiple inheritance in java3 (1).pptxMultiple inheritance in java3 (1).pptx
Multiple inheritance in java3 (1).pptx
 
Inheritance in java
Inheritance in java Inheritance in java
Inheritance in java
 
Inheritance
InheritanceInheritance
Inheritance
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
 
INHERITANCE IN JAVA.pptx
INHERITANCE IN JAVA.pptxINHERITANCE IN JAVA.pptx
INHERITANCE IN JAVA.pptx
 
Inheritance
InheritanceInheritance
Inheritance
 
Multiple inheritance possible in Java
Multiple inheritance possible in JavaMultiple inheritance possible in Java
Multiple inheritance possible in Java
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwords
 
Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
 
SodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptx
SodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptxSodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptx
SodaPDF-converted-inheritanceinjava-120903114217-phpapp02-converted.pptx
 
OOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfOOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdf
 
Java Inheritance
Java InheritanceJava Inheritance
Java Inheritance
 
Java_notes.ppt
Java_notes.pptJava_notes.ppt
Java_notes.ppt
 
Java for android developers
Java for android developersJava for android developers
Java for android developers
 
Inheritance in Java
Inheritance in JavaInheritance in Java
Inheritance in Java
 
4th_class.pdf
4th_class.pdf4th_class.pdf
4th_class.pdf
 
The smartpath information systems java
The smartpath information systems javaThe smartpath information systems java
The smartpath information systems java
 

Recently uploaded

Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxFamilyWorshipCenterD
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@vikas rana
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...marjmae69
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !risocarla2016
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxJohnree4
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxnoorehahmad
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGYpruthirajnayak525
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxCarrieButtitta
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSebastiano Panichella
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxmavinoikein
 

Recently uploaded (20)

Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptx
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptx
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptx
 

Inheritance in JAVA PPT

  • 1.
  • 2. Contents • Introduction of Inheritance 3 • Classes classification 4  Super class  Intermediate class  Child class • Relation between classes 5 • Super class 6 • Intermediate class 7 • Child class 8 • Types of Inheritance 9  Single Inheritance  Multilevel Inheritance  Hierarchical Inheritance • Single Inheritance 10 • Multilevel Inheritance 11 • Hierarchical Inheritance 12 • Indirect Mechanism of Inheritance 13 • A program demonstrating inheritance 14 • Limitations 15
  • 3. INHERITANCE • One of the most effective features of Oop’s paradigm. • Establish a link/connectivity between 2 or more classes. • Permits sharing and accessing properties from one to another class. • to establish this relation Java uses ‘extends’ keyword.
  • 4. Category of Classes on the Basis of Inheritance Super class (base/parent/driver/inheritance/ ancestor class). Intermediate class (mediating/dual class). Child class (sub/associate/derived/inherited class).
  • 6. Super class Top located class Service provider (its properties accessed by all its lower level class).
  • 7. Intermediate class Middle located class Having Dual policy (obtain properties of upper level class and transmit properties to lower level class).
  • 8. Child class Bottom located class much benefitted class much loaded class properties of child class as well as class and parent class can be accessed by only the object of child class.
  • 9. TYPES of INHERITANCE • Single Inheritance • Multilevel Inheritance • Hierarchical Inheritance
  • 10. Single Inheritance • A structure having one and only one parent as well as child class. • Child class is authorized to access the property of Parent class. Syntax :
  • 11. Multilevel Inheritance • Standard structure of Single Inheritance having one Parent, one or more intermediate and one child classes. • Child class as well as intermediate class may access the properties of upper level classes. Syntax :
  • 12. Hierarchical Inheritance A structure having one parent and more child class. Child classes must be connected with only Parent class. Syntax :
  • 13. Java Supports a special feature called interface. This feature helps to connect a class with more than one classes. For this type of connectivity java uses ‘implements’ keyword. Syntax : interface A{ ……..} Interface B { ____} class M { -------} class N implements A,B extends M{ ===== _____------…………}
  • 14. A Program demonstrating Inheritance in Java import java.util.*; import java.io.*; interface Prn1{ void Bits(int x);} interface Prn2{ void Bytes();} class Prn3{ void Mega(){ int x=5,y,i=1; long z=1; while(i<=10){ y=x*i; i++; //System.out.println(y); z=z*y; } System.out.println("Product of Table of 5 : "+z);}} class RPT extends Prn3 implements Prn2{ int x,y,z; void Bits(int a){ if(a%3==0) System.out.println("nnn"+a+" is modulated by 3.nn"); else System.out.println("nnn"+a+" is not modulated by 3.nn");} public void Bytes(){ Scanner S=new Scanner(System.in); x=10; System.out.print("Enter a no. for a rectangle width : "); y=S.nextInt(); z=x*y; System.out.println("nnArea of rectangle : "+x+"x"+y+"="+z); System.out.println();}} class Intrfc{ public static void main(String[] Arg){ RPT obj=new RPT(); obj.Bits(16); obj.Bytes(); obj.Mega();}} Output : 16 is not modulated by 3. Enter a no. for a rectangle width : 20 Area of rectangle : 10x20=200 Product of table of 5 : 35437500000000
  • 15. • Link is establish into single direction(Fig). Java not support Multiple inheritance as well as Hybrid inheritance. The extends keyword permits to connect a class with only one class. In Interface, properties are only declared and assined, but n’ver defined.