際際滷

際際滷Share a Scribd company logo
1.         Abstract class is a class which contain one or more abstract methods, which has to be implemented by sub classes              . Inteface is a Java Object containing method
                      declaration and doesn't contain implementation. The classes which have implementing the Interfaces must provide the method defination for all the methods.2. Abstract class is a
                      Class prefix wtih a abstract keyword followed by Class definaton. Interacace is a Interface which starts with interface keyword.3. Abstract class contatins one or more abstract
                      methods. where as Interface contains all abstract methods and final declarations.4. Abstract class contains the method defination of the some methods. but Interface contains only
                      method declaration, no defination provided.5. Abstract classes are useful in a situation that Some general methods should be implemented and specialization behaviour should be
                      implemented by child classes. Interafaces are useful in a situation that all properties should be implemented we can use this scenario




Interface                                                                      Abstract Class
---------------------------------------------------------------------------

(1)     Decelear with keyword                       (1) Decelear with keyword
        interface                                          Abstract.
(2)     It will not                         (2) Itwill may or may             contain   Constructor.               Constructor.
(3) By default all methods                        (3) It may contact Abstract
    are Public AbstractMethods.                        methods and non
                                                Abstract methods.
(4) it will contain only                         (4) It will final variables and
      final variables,                               Instances Variables.




2. There is two defference between static inner and non
static inner class.
I)In the case of declaring data memeber and member method
, non static inner class cannot have static data member
and static member method
But Static Inner class can have static and
non static data member and member method



II) In the case of creating instance, the instance of non s
static inner class is created with the reference of
object of outer class in which it is definedthis
means it have inclosing instance .
But the instance of static inner class
is created with the reference of Outer class, not with
the reference of object of outer class..this means it
have not inclosing instance
For example
class A
{
class B
{
// static int x; not allowed here..



}
static class C
{
static int x; // allowed here
}
}



class Test
{
public static void main(String str)
{
A o=new A();
A.B obj1 =o.new B();//need of inclosing instance



A.C obj2 =new A.C();



// not need of reference of object of outer class.
}
}




3. Java Final Keyword

More Related Content

What's hot (20)

PDF
Oops presentation java
JayasankarPR2
PPTX
Java interfaces
Elizabeth alexander
PDF
Interface
Shantilal Bhayal
PPTX
Abstract Class Presentation
tigerwarn
PPT
Interfaces
myrajendra
PPT
Java interfaces
RanjithaM32
PDF
8 abstract classes and interfaces
Tuan Ngo
DOC
C# interview questions
Chetan Chaudhari
PPTX
WHAT IS ABSTRACTION IN JAVA
sivasundari6
PPT
Encapsulation
FALLEE31188
PPTX
#OOP_D_ITS - 8th - Class Diagram
Hadziq Fabroyir
PPTX
Java interfaces
jehan1987
PPTX
If and select statement
Rahul Sharma
PPTX
Java Interface
Manish Tiwari
PDF
Javapolymorphism
karthikenlume
DOCX
25 java tough interview questions
Arun Banotra
PPTX
Interface in java
PhD Research Scholar
PPTX
2CPP09 - Encapsulation
Michael Heron
PPTX
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
Simplilearn
Oops presentation java
JayasankarPR2
Java interfaces
Elizabeth alexander
Interface
Shantilal Bhayal
Abstract Class Presentation
tigerwarn
Interfaces
myrajendra
Java interfaces
RanjithaM32
8 abstract classes and interfaces
Tuan Ngo
C# interview questions
Chetan Chaudhari
WHAT IS ABSTRACTION IN JAVA
sivasundari6
Encapsulation
FALLEE31188
#OOP_D_ITS - 8th - Class Diagram
Hadziq Fabroyir
Java interfaces
jehan1987
If and select statement
Rahul Sharma
Java Interface
Manish Tiwari
Javapolymorphism
karthikenlume
25 java tough interview questions
Arun Banotra
Interface in java
PhD Research Scholar
2CPP09 - Encapsulation
Michael Heron
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
Simplilearn

Viewers also liked (12)

DOCX
Andrew jackson was the seventh president of the united states
bettylmyers
PDF
Site BBel (3尊 parte)
LUIETTE ORNELLAS PRODUES DE EVENTOS
PPTX
犖犖犖萎硯犖園犖
kat0880389901
PDF
PREFASS Limousin - Seminaire 1516
vincent enrico
PDF
Renato Resume
Renato Salgado
DOCX
What gender are you
McLeodJake
DOC
New resume Naveen (1)
Naveen Joy
DOCX
AMOS PIX
Amos Aigbokhai
PDF
Go2 endorsement letter
Laetitia Jonnery
PPTX
Linea de tiempo para el momento de lecto escritura
Lina Maria Caro Alvarez
DOC
Analice y acent炭e 07 (madre teresa de calcuta)
laura Dahmen abud
PDF
2012 letf ms73
kvjraghunath
Andrew jackson was the seventh president of the united states
bettylmyers
Site BBel (3尊 parte)
LUIETTE ORNELLAS PRODUES DE EVENTOS
犖犖犖萎硯犖園犖
kat0880389901
PREFASS Limousin - Seminaire 1516
vincent enrico
Renato Resume
Renato Salgado
What gender are you
McLeodJake
New resume Naveen (1)
Naveen Joy
AMOS PIX
Amos Aigbokhai
Go2 endorsement letter
Laetitia Jonnery
Linea de tiempo para el momento de lecto escritura
Lina Maria Caro Alvarez
Analice y acent炭e 07 (madre teresa de calcuta)
laura Dahmen abud
2012 letf ms73
kvjraghunath
Ad

Similar to Vvi (20)

PDF
OOPs difference faqs-3
Umar Ali
PPTX
Difference between Abstract class and Interface.pptx
ArunPatrick2
PPT
9 abstract interface
Abhijit Gaikwad
PDF
What are abstract classes Dont interfaces also allow for polymo.pdf
arihantkitchenmart
PPT
06 abstract-classes
Abhishek Khune
PPT
06 abstract-classes
Anup Burange
DOC
Complete java&j2ee
Shiva Cse
PDF
Abstract classes and Methods in java
Harish Gyanani
PPT
ABSTRACT CLASSES AND INTERFACES.ppt
JayanthiM15
PDF
Exception handling and packages.pdf
Kp Sharma
PPTX
Abstraction in java [abstract classes and Interfaces
Ahmed Nobi
PPT
OOPS_AbstractClasses_explained__java.ppt
JyothiAmpally
PDF
javainterface
Arjun Shanka
DOC
116824015 java-j2 ee
homeworkping9
DOC
Interface Vs Abstact
Anand Kumar Rajana
PPT
Chapter 9 Interface
OUM SAOKOSAL
PPTX
Abstraction1
zindadili
PPTX
Abstract classes & interfaces
moazamali28
PPTX
Interface in java
Kavitha713564
PPTX
Abstract class and Interface
Haris Bin Zahid
OOPs difference faqs-3
Umar Ali
Difference between Abstract class and Interface.pptx
ArunPatrick2
9 abstract interface
Abhijit Gaikwad
What are abstract classes Dont interfaces also allow for polymo.pdf
arihantkitchenmart
06 abstract-classes
Abhishek Khune
06 abstract-classes
Anup Burange
Complete java&j2ee
Shiva Cse
Abstract classes and Methods in java
Harish Gyanani
ABSTRACT CLASSES AND INTERFACES.ppt
JayanthiM15
Exception handling and packages.pdf
Kp Sharma
Abstraction in java [abstract classes and Interfaces
Ahmed Nobi
OOPS_AbstractClasses_explained__java.ppt
JyothiAmpally
javainterface
Arjun Shanka
116824015 java-j2 ee
homeworkping9
Interface Vs Abstact
Anand Kumar Rajana
Chapter 9 Interface
OUM SAOKOSAL
Abstraction1
zindadili
Abstract classes & interfaces
moazamali28
Interface in java
Kavitha713564
Abstract class and Interface
Haris Bin Zahid
Ad

Vvi

  • 1. 1. Abstract class is a class which contain one or more abstract methods, which has to be implemented by sub classes . Inteface is a Java Object containing method declaration and doesn't contain implementation. The classes which have implementing the Interfaces must provide the method defination for all the methods.2. Abstract class is a Class prefix wtih a abstract keyword followed by Class definaton. Interacace is a Interface which starts with interface keyword.3. Abstract class contatins one or more abstract methods. where as Interface contains all abstract methods and final declarations.4. Abstract class contains the method defination of the some methods. but Interface contains only method declaration, no defination provided.5. Abstract classes are useful in a situation that Some general methods should be implemented and specialization behaviour should be implemented by child classes. Interafaces are useful in a situation that all properties should be implemented we can use this scenario Interface Abstract Class --------------------------------------------------------------------------- (1) Decelear with keyword (1) Decelear with keyword interface Abstract. (2) It will not (2) Itwill may or may contain Constructor. Constructor. (3) By default all methods (3) It may contact Abstract are Public AbstractMethods. methods and non Abstract methods. (4) it will contain only (4) It will final variables and final variables, Instances Variables. 2. There is two defference between static inner and non static inner class. I)In the case of declaring data memeber and member method , non static inner class cannot have static data member and static member method But Static Inner class can have static and non static data member and member method II) In the case of creating instance, the instance of non s static inner class is created with the reference of object of outer class in which it is definedthis means it have inclosing instance . But the instance of static inner class is created with the reference of Outer class, not with the reference of object of outer class..this means it have not inclosing instance For example class A { class B { // static int x; not allowed here.. } static class C { static int x; // allowed here } } class Test { public static void main(String str) { A o=new A(); A.B obj1 =o.new B();//need of inclosing instance A.C obj2 =new A.C(); // not need of reference of object of outer class. } } 3. Java Final Keyword