You are on page 1of 1
so12s12022 Lesson Object-Oriented Programming Concepts (The Java™ Tutorials » Learning the Java Language) Documentation The Java™ Tutorials ‘ral: Learning he Java Language ‘The Java Tulorals have been writen for JOK 8. Examples and practices described in this page don take advantage of imorovernents introduced in lator releases ond might use technology ne longer avaiabo ‘See Java Language Changes for@ summary of updated language features in Java SE 9 and subsequent releases. ‘See JOK Release Notes for information about new features, enhancements, and romoved or deprecated options forall JK releases. Lesson: Object-Oriented Programming Concepts I youve never used an cbject-viente programming language before, youll nes to leam a few basic concepts before you can begin writing any code, This lesson wil invoduce you to objects, classes, inherance, Interfaces, and packages, Each discussion focuses on how these concepts relate tothe real word, while simultaneously providing an introduction tothe syntax of the Java programming language. What Is an Object? [An objctis a software bundlo of related state and bohavie. Stare objects are offen used to madel the real-world objects that you niin everyday We, This lesson explains now state and behavior are represented within an objec, introduces the concept of data encapsulation, and exphins the benefits of designing your software in tis manner. What Is a Class? ‘A. class is Buoprint or prototype trom which cbjacts are croated. This section dofinos a clas that madels te state and bohavior of a rabwortd ‘object, tinenionally focuses on the basic, showing how even simple class can cleanly model state and behavir. What Is Inheritance? Inneritance provides a powerful and natural mechanism fr organizing and sirecuring your sofware. This section explains how classes inher state “and behavior rom ther superclastes, anc explains how to derive one class from another using the simole syntax provided by the Java programming language, What Is an Interface? ‘An interface isa contract between a class and the outside world. When a dass implements an interface, it promises to provide the behavior published by tat interface. This section defines a simple interface and explains the necessary changes for any class thal implements it What Is a Package? ‘package sa namespace for argniing classes and Inerfaces na gical manner. Placing your code into packages makes lrg sofware projets ‘easir to manage. This section explains why hiss use, and inrecuces you othe Application Programming Ilrface (AI) proved by he ava station, Questions and Exercises: Object-Oriented Programming Concepts Use the questions and exercises presented in his section to tost your understanding of objects, classes, inbertance, interfaces, and packages, Previous page: Table of Contos [Next page: What Is an Object? ‘GoskiaPreferancas [Aa Choloas hitpssidocs.oracle.comavaseftutorialjavaiconceptsindex html an

You might also like