• Save
Java Basics & OOP's Concepts
Upcoming SlideShare
Loading in...5

Java Basics & OOP's Concepts



Basics of Java, Features of Java, OOP's Concepts

Basics of Java, Features of Java, OOP's Concepts



Total Views
Slideshare-icon Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Java Basics & OOP's Concepts Java Basics & OOP's Concepts Presentation Transcript

    • Java- Basics & OOP’s Concepts 1 Er. Amit Kumar Sinha E-mail : sinha.amit95@gmail.com Facebook : facebook.com/sinha70 Twitter : twitter.com/sinha010
    • Basics of Java  OBJECT : An Object is anything which exists in this real world. Example – pen, door, etc.  CLASS : Group or Collection of Objects is called Class.  METHOD : The Operation which is attached with an object is called Method. Example : Student is an Object which has attributes such as name, address, roll no., etc. and it has methods such as play(), study(), write(), etc. 2
    • Features of Java 1. Compile & Interpreted Language : Java codes are compiled by Compiler and then executed by Interpreter. The diagram shows the process : 3 Source Code Compiler Byte Code Interpreter Machine Code Compiler converts Source Code to Byte Code, while, Interpreter converts Byte Code to Machine Code.
    • Features of Java (cont..) 2. Portability : Java is Portable because its code can run in any OS like Windows, Unix, etc. 3. Robustness : Look at the code which I have written below : #include<studio.h> void main( ) { int a=10; int c= a/0; printf(“%d”, c); } If we try to run the above code in any language, the above code will not execute but in Java a special feature called Exception Handling is introduced due to which the above code executes in Java and a run-time exception occurs. Due to Exception Handling, Java is a Robust Language. 4
    • Features of Java (cont..) 4. Secure : • Java uses no pointer, so it is secure. • Java follows client-server architecture. 5. Dynamic : Java is dynamic because when we use import keyword, it copies all methods of package in a temporary memory and from this temporary memory methods are taken to our program. While in C or C++, the page became heavy because all the header files were stored in our program . 5
    • Object Oriented Programming (OOPs) 6 • ABSTRACTION : Abstraction is a feature of OOP’s in which we show essential features of an object without including the background details. For Example : Suppose we consider an object CAR, the essentials features of CAR are Sterring, Company Name ( Tata, Hyundai, etc) , Mileage, Color, etc. while the hidden or background details are Tyres, Brakes, etc. (con…)
    • Object Oriented Programming (OOPs) (con..) 7 • ENCAPSULATION : Encapsulation is a feature of OOP’s which means wrapping of data or objects into a single unit. For Example : There are two teachers (objects), one teacher teaches physics while other teaches chemistry and they both teaches at different places. If we unite them together, it means if both teachers decide to teacher together (wrapping of objects) in a common place, then this feature is known an encapsulation. (con…)
    • Object Oriented Programming (OOPs) (con..) 8 • POLYMORPHISM : If same method or function behaves differently in two different classes, then this feature is known as Polymorphism. For Example : Class A Class B { { void display ( ) void display ( ) { { System.out.println(“First”); System.out.println(“Second”); } } } } (con…)
    • Object Oriented Programming (OOPs) (con..) 9 • INHERITANCE: It is a feature of OOP’s in which a SUB CLASS inherits Properties of SUPER CLASS. For Example : Class A Class B extends A { { void display_one ( ) void display_two ( ) { { System.out.println(“First”); System.out.println(“Second”); } } } } (con…)
    • Object Oriented Programming (OOPs) (con..) 10 There are 4 kinds of Inheritance : 1. Single Inheritance 2. Multi-level Inheritance 3. Multiple Inheritance 4. Hierarchal Inheritance JAVA DOESN’T SUPPORT MULTIPLE INHERITANCE BUT IF WE USE INTERFACE, JAVA SUPPORTS MULTIPLE INHERITANCE.
    • 11