SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
CHAPTER 8
ABSTRACT & INTERFACE
Mr.Warawut Khangkhan
e-Mail: awarawut@hotmail.com
Social Media: www.facebook.com/AjWarawut
Mr.Warawut Khangkhan   Chapter 8 Thread
                       Chapter 8 Thread
                                          ABSTRACT
                                                     2
ABSTRACT CLASS




                                                   Mr.Warawut
                                                    Khangkhan
 ˈ         F F           ˈ
Abstract Method




                                                       Chapter 8 Thread
Abstract Method                    F           F
    F
        F    F             F           F
   F ˈ             F           F
       F F     F     F F                   F
      Overriding Method                            3
ABSTRACT CLASS




                                    Mr.Warawut
                                     Khangkhan
               Abstract Class F
               Abstract Method F




                                        Chapter 8 Thread
        F          F  F
Abstract Class          F
 F         F F   F        F     F
      F Implementation F F
          F Implementation F F
Concrete Method                     4
F ABSTRACT CLASS




                                     Mr.Warawut
                                      Khangkhan
  abstract
abstract class AbstractClassName {
     [AbstractMethodNames]
      AbstractMethodNames]




                                         Chapter 8 Thread
     [ConcreteMethodNames]
      ConcreteMethodNames]
}

AbstractMethodNames
     ˈ F           Abstract Method
         F     F F
       F   F F 1                     5
F   ABSTRACT CLASS




                                          Mr.Warawut
                                           Khangkhan
class ClassName extends AbstractClassName {
     AbstractMethodNames(
     AbstractMethodNames( ) {




                                             Chapter 8 Thread
          [Statements];
     }
}




                                         6
Mr.Warawut
             Chapter 8 Thread
 Khangkhan
                                7
Mr.Warawut Khangkhan   Chapter 8 Thread
                                 Thread
                                          INTERFACE
                                                      8
INTERFACE




                                       Mr.Warawut
                                        Khangkhan
     ˈ             ˈ Abstract Method
               F     F F F        F




                                           Chapter 8 Thread
 F       ˈ F




                                       9
F INTERFACE




                                        Mr.Warawut
                                         Khangkhan
  abstract
[modifier] interface InterfaceName {




                                          Chapter 8 Thread
}

Interface         F Abstract Method
 F        Abtract Class F
implements          F  F          F
         F Abstract Method F        F
     F F                                10
F   INTERFACE




                                        Mr.Warawut
                                         Khangkhan
[modifier] class ClassName implements
InterfaceName {




                                          Chapter 8 Thread
      AbstractMethodNames(
      AbstractMethodNames( ) {
           [Statements];
      }
}

           Example Ch08_02.java

                                        11
F       F    F ABSTRACT CLASS
      INTERFACE




                                    Mr.Warawut
                                     Khangkhan
    Abstract Class ˈ          F
    2                   (Concrete




                                      Chapter 8 Thread
    Method)         F
    (Abstract Method)    Abstract
    Class F
                  F

                                    12
F        F    F ABSTRACT CLASS
      INTERFACE




                                       Mr.Warawut
                                        Khangkhan
    Interface ˈ        F
      Interface F            F




                                         Chapter 8 Thread
         F       Interface F
       F ˈ      Implements Interface




                                       13
F        F       F ABSTRACT CLASS
      INTERFACE




                                    Mr.Warawut
                                     Khangkhan
                 Abstract Class F
             F




                                      Chapter 8 Thread
            F Interface F      F
    Interface    F Interface F
    Multiple Inheritance F


                                    14
Mr.Warawut Khangkhan   Chapter 8 Thread
                                 Thread
                                          MULTIPLE INHERITANCE
                                                                 15
MULTIPLE INHERITANCE




                               Mr.Warawut
                                Khangkhan
                  SuperClass
           F  F SubClass




                                 Chapter 8 Thread
    F     Amphibian
      Car
Boat
   Amphibian
        F
      2                        16
F       F   MULIPLE
INTERFACE




                                        Mr.Warawut
                                         Khangkhan
   abstract
[modifier] class ClassName implements
InterfaceName_1 InterfaceName_2
InterfaceName_1, InterfaceName_2, …,




                                          Chapter 8 Thread
InterfaceName_n {

}




                                        17

Weitere ähnliche Inhalte

Mehr von Warawut

Database design
Database designDatabase design
Database designWarawut
 
Business Computer Project 4
Business Computer Project 4Business Computer Project 4
Business Computer Project 4Warawut
 
Object-Oriented Programming 10
Object-Oriented Programming 10Object-Oriented Programming 10
Object-Oriented Programming 10Warawut
 
Management Information System 6
Management Information System 6Management Information System 6
Management Information System 6Warawut
 
Management Information System 5
Management Information System 5Management Information System 5
Management Information System 5Warawut
 
Management Information System 4
Management Information System 4Management Information System 4
Management Information System 4Warawut
 
Object-Oriented Programming 5
Object-Oriented Programming 5Object-Oriented Programming 5
Object-Oriented Programming 5Warawut
 
Business Computer Project 3
Business Computer Project 3Business Computer Project 3
Business Computer Project 3Warawut
 
Management Information System 3
Management Information System 3Management Information System 3
Management Information System 3Warawut
 
Business Computer Project 2
Business Computer Project 2Business Computer Project 2
Business Computer Project 2Warawut
 
Chapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemChapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemWarawut
 
Business Computer Project 1
Business Computer Project 1Business Computer Project 1
Business Computer Project 1Warawut
 
Chapter 1 Organization & MIS
Chapter 1 Organization & MISChapter 1 Organization & MIS
Chapter 1 Organization & MISWarawut
 
Object-Oriented Programming 3
Object-Oriented Programming 3Object-Oriented Programming 3
Object-Oriented Programming 3Warawut
 
Object-Oriented Programming 2
Object-Oriented Programming 2Object-Oriented Programming 2
Object-Oriented Programming 2Warawut
 
Object-Oriented Programming 1
Object-Oriented Programming 1Object-Oriented Programming 1
Object-Oriented Programming 1Warawut
 
Upload File
Upload FileUpload File
Upload FileWarawut
 
Session and Cookie
Session and CookieSession and Cookie
Session and CookieWarawut
 
Form Validation
Form ValidationForm Validation
Form ValidationWarawut
 

Mehr von Warawut (20)

Database design
Database designDatabase design
Database design
 
Business Computer Project 4
Business Computer Project 4Business Computer Project 4
Business Computer Project 4
 
Object-Oriented Programming 10
Object-Oriented Programming 10Object-Oriented Programming 10
Object-Oriented Programming 10
 
Management Information System 6
Management Information System 6Management Information System 6
Management Information System 6
 
Management Information System 5
Management Information System 5Management Information System 5
Management Information System 5
 
Management Information System 4
Management Information System 4Management Information System 4
Management Information System 4
 
Object-Oriented Programming 5
Object-Oriented Programming 5Object-Oriented Programming 5
Object-Oriented Programming 5
 
Business Computer Project 3
Business Computer Project 3Business Computer Project 3
Business Computer Project 3
 
Management Information System 3
Management Information System 3Management Information System 3
Management Information System 3
 
Business Computer Project 2
Business Computer Project 2Business Computer Project 2
Business Computer Project 2
 
Chapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemChapter 2 Strategy & Information System
Chapter 2 Strategy & Information System
 
Business Computer Project 1
Business Computer Project 1Business Computer Project 1
Business Computer Project 1
 
Chapter 1 Organization & MIS
Chapter 1 Organization & MISChapter 1 Organization & MIS
Chapter 1 Organization & MIS
 
Object-Oriented Programming 3
Object-Oriented Programming 3Object-Oriented Programming 3
Object-Oriented Programming 3
 
Object-Oriented Programming 2
Object-Oriented Programming 2Object-Oriented Programming 2
Object-Oriented Programming 2
 
Object-Oriented Programming 1
Object-Oriented Programming 1Object-Oriented Programming 1
Object-Oriented Programming 1
 
Upload File
Upload FileUpload File
Upload File
 
Login
LoginLogin
Login
 
Session and Cookie
Session and CookieSession and Cookie
Session and Cookie
 
Form Validation
Form ValidationForm Validation
Form Validation
 

Kürzlich hochgeladen

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 

Kürzlich hochgeladen (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 

Object-Oriented Programming 8

  • 1. CHAPTER 8 ABSTRACT & INTERFACE Mr.Warawut Khangkhan e-Mail: awarawut@hotmail.com Social Media: www.facebook.com/AjWarawut
  • 2. Mr.Warawut Khangkhan Chapter 8 Thread Chapter 8 Thread ABSTRACT 2
  • 3. ABSTRACT CLASS Mr.Warawut Khangkhan ˈ F F ˈ Abstract Method Chapter 8 Thread Abstract Method F F F F F F F F ˈ F F F F F F F F Overriding Method 3
  • 4. ABSTRACT CLASS Mr.Warawut Khangkhan Abstract Class F Abstract Method F Chapter 8 Thread F F F Abstract Class F F F F F F F F Implementation F F F Implementation F F Concrete Method 4
  • 5. F ABSTRACT CLASS Mr.Warawut Khangkhan abstract abstract class AbstractClassName { [AbstractMethodNames] AbstractMethodNames] Chapter 8 Thread [ConcreteMethodNames] ConcreteMethodNames] } AbstractMethodNames ˈ F Abstract Method F F F F F F 1 5
  • 6. F ABSTRACT CLASS Mr.Warawut Khangkhan class ClassName extends AbstractClassName { AbstractMethodNames( AbstractMethodNames( ) { Chapter 8 Thread [Statements]; } } 6
  • 7. Mr.Warawut Chapter 8 Thread Khangkhan 7
  • 8. Mr.Warawut Khangkhan Chapter 8 Thread Thread INTERFACE 8
  • 9. INTERFACE Mr.Warawut Khangkhan ˈ ˈ Abstract Method F F F F F Chapter 8 Thread F ˈ F 9
  • 10. F INTERFACE Mr.Warawut Khangkhan abstract [modifier] interface InterfaceName { Chapter 8 Thread } Interface F Abstract Method F Abtract Class F implements F F F F Abstract Method F F F F 10
  • 11. F INTERFACE Mr.Warawut Khangkhan [modifier] class ClassName implements InterfaceName { Chapter 8 Thread AbstractMethodNames( AbstractMethodNames( ) { [Statements]; } } Example Ch08_02.java 11
  • 12. F F F ABSTRACT CLASS INTERFACE Mr.Warawut Khangkhan Abstract Class ˈ F 2 (Concrete Chapter 8 Thread Method) F (Abstract Method) Abstract Class F F 12
  • 13. F F F ABSTRACT CLASS INTERFACE Mr.Warawut Khangkhan Interface ˈ F Interface F F Chapter 8 Thread F Interface F F ˈ Implements Interface 13
  • 14. F F F ABSTRACT CLASS INTERFACE Mr.Warawut Khangkhan Abstract Class F F Chapter 8 Thread F Interface F F Interface F Interface F Multiple Inheritance F 14
  • 15. Mr.Warawut Khangkhan Chapter 8 Thread Thread MULTIPLE INHERITANCE 15
  • 16. MULTIPLE INHERITANCE Mr.Warawut Khangkhan SuperClass F F SubClass Chapter 8 Thread F Amphibian Car Boat Amphibian F 2 16
  • 17. F F MULIPLE INTERFACE Mr.Warawut Khangkhan abstract [modifier] class ClassName implements InterfaceName_1 InterfaceName_2 InterfaceName_1, InterfaceName_2, …, Chapter 8 Thread InterfaceName_n { } 17