Sie sind auf Seite 1von 6

Java & Android

Programming:- Set of instruction to perform a Specific Task

OOP’s:-

Object-oriented programming System (OOPs) is a programming paradigm


based on the concept of “objects” that contain data and methods.

1) Class: Set of Variable and Methods.


2) Object: Instance of Class
3) Encapsulation: Encapsulation is a process of combining data and
function into a single unit like capsule.
4) Abstraction: Abstraction is a process of hiding irrelevant details from
user.
5) Inheritance: Inheritance is a feature using which an object of child class
acquires the properties of parent class.
6) Polymorphism: Polymorphism is a feature using which an object
behaves differently in different situation.

Variable:-

X=10;

x – variable

10- assistance value

Data Types:-

1. int- 2,4,6
2. float-6.8,7.8
3. double -8.999999
4. char- ‘a’,’5’
5. string- “a”,”2”

int x; Initialized

x=10

Set Java Path:-

JDK:- Java Development Kit

How to configure JDK Path:-

1) C Drive  Program files  Java  jdk 1.7  bin  Copy The Path

2) Computer  Properties  Advance Setting  Environment &


Variable  New  Variable Name:- Path

Variable Value:- Paste The Path

Ok

Program:-

Class A

{
Static Void Main()

System.out.println(“Hello”);

Class B

Public Static Void Main(String args[])

A ao=new A(); //created object

ao.hello();

To Compile:

javac filename.java

To Run:

java classname

For Scan Element:-

import java.util.Scanner;
class A

public static void main(String args[])

Scanner so=new Scanner(System.in);

int x,y;

System.out.println("Enter the value of x:");

x=so.nextInt();

System.out.println("Enter the value of y:");

y=so.nextInt();

x=x+y;

y=x-y;

x=x-y;

System.out.println("new value of x is:"+x);

System.out.println("new value of y is:"+y);

}
Operator:-

1. Arithmetic:- + , - , = , * , / , %

2. Relational:- < , <= , > , >= , == , !=


3. Logical:- && , || , !
4. Increment/Decrement:- ++ , --
5. Assign:- =

Loop:-

1) do:- condition check then execute


2) for:-execute repeatedly manner
3) do while:-execute then check condition
4) inhance:-

Array [ ] :-

1 dimension

2 dimension

Encapsulation:-

Public Private Protected


Inheritance:-

1. Single
2. Multilevel
3. Multiple
4. Hierarchical

Das könnte Ihnen auch gefallen