



























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




























4
.class file
machine code
Types of Programming
-Structured Programming Approach
-Object Oriented Programming Approach
Structures Programming Approach
Mainly function Oriented.. Programs are based on functions.
Example C
as a single unit in a class. This concept is known as Object Orientation. This approach is known as Object Orientated Approach.
Example:-
as a single unit in a class. This concept is known as Object Orientation. This approach is known as Object Orientated Approach.
Example:-
RealLife Object: State-Variable
Behavior-method
ENCAPSULATION Binding or Wrapping of the data and methods into a single unit is called Encapsulation. Encapsulation is used to hide data or protect data from outside access. So this concept is also called data-hiding.
ABSTRACTION Abstraction refers to the act of representing essential features without including the background details and explanation.
explanation the capsule cures the patient.. But the patient don‘t know what is capsulated inside the capsule…..
MEDICINE INSIDE THE CAP
Simple java program
class A
{
public static void main(String arr[]) { System.out.println(―Hello World‖); }
}
Simple java program
class A { public static void main(String arr[]) { System.out.println(―Hello World‖); } }
Public is a access specifier that declares the method ad unprotected and therefore making it accessible to all other classes.
Static static is a keyowrd ,which declares this method as one that belongs to the entire class and not a part of any objects of the class.
Void does not return anything. docsity.com
Simple java program
class A { public static void main(String arr[]) Defining main method { System.out.println(―Hello World‖); } }
arr[]takes the values of command line arguments..
Suppose we are giving a b c darr[0]=a,arr[1]=b,arr[2]=c,arr[3]=d
Example Showing Encapsulation
class Encapsulation { private int height; private int width; private int length; public void init() { height=100; width=100; length=100; }