Advertisement
jigsaww

Java Introduction

Dec 9th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. -------------------------------------OBJECT ORIENTED PROGRAMMING--------------------------------
  2. Benefits of OOP:
  3. 1.Source code of an object can be maintained indepedently.
  4. 2.Interactions happen only with the object methods which helps in hiding the actual implementation and provides a secure environment.
  5. 3.If an object has already been programmed by someone, it can be re-used to re-create the same object.
  6. 4.If a object is problematic it is easy just to debug THAT ONE object and plug it back again in the program making debugging easy.
  7. -------------------------------------========================-----------------------------------
  8.  
  9. ------------------------------------------CLASS-------------------------------------------------
  10. A class is a blueprint or prototype from which objects are created.
  11. An object made from a class is called as an "instance" of the class.
  12. -------------------------------------------------------------------------------------------------
  13.  
  14. -----------------------------------INHERITANCE---------------------------------------------------
  15. A subclass can inherit properties and methods for a superclass. To create a subclass, the 'extends' keyword is used.
  16. class Java extends ProgrammingLanguages {
  17. //Your code here;
  18. }
  19. The meaning of the code is that there is an existing class called "ProgrammingLanguages" and a subclass named "Java" has been created which "INHERITS" the properties of "ProgrammingLanguages". It must be noted that the class "Java" can also have it's own methods and properties. A subclass can override the properties of it's superclass. Keep in mind that the inherited source code is not saved in the file during compilation.
  20. -------------------------------------------------------------------------------------------------
  21.  
  22. ---------------------------------INTERFACE-------------------------------------------------------
  23. An interface is a contract between a class and the outside world.
  24. The methods of a class if declared as an interface can be implemented on other class by using the "implements" keyword similarly to the "extends" keyword.
  25. -------------------------------------------------------------------------------------------------
  26.  
  27. ---------------------------------PACKAGE---------------------------------------------------------
  28. A package is a namespace that organizes a set of related classes and interfaces. The Java platform provides an enormous class library (a set of packages) suitable for use in your own applications. This library is known as the "Application Programming Interface", or "API" for short.
  29. -------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement