Sei sulla pagina 1di 4

PROGRAMMING LANGUAGES

1)UNSTRUCTURED PROGRAMMING
2)STRUCTURED PROGRAMMING
3)PROCEDURAL PROGRAMMING
4)MODULAR PROGRAMMING
5)OBJECT ORIENTED PROGRAMMING;
>> u know every object has a 1)properties 2)behaviour
FEATURES OF JAVA
1)SIMPLE
2)PLATFORM INDEPENDENT
3)OBJECT-ORIENTED...................ETC
>>platform independent is the best feature of java
>>simply we call java as 'WORA'(write once run anywhere)-platform independent
>>different types of JVM available on different types of operating Systems
EX:SUN-JVM
MICROSOFT-JVM
IBM-JVM
>>same .class files can run on various platforms
>>this is the way "BYTECODE" executes java programs
>>proves java is platform independent language!
1)WHAT IS MAENT BY "JIT" COMPILER??
JIT compiler is a compiler that converts program source code into native mechine
code just before running the program.
>>faster and more efficient to perform huge application

OBJECTS & CLASSES


@@ some of steps to perform the programming
>>Get a problem statement
>>think object oriented(in this we think about two things 1)what are the object
s? 2)how do they interact?)
>>design the oo solution Abstract out details
>>code up your objects Encapsulation,Inheritance
>>test your code
>>ship it
2)WHAT IS AN OBJECT??
Object(foot ball)
HAS
color
diameter
brand
"PROPERTIES"

DOES
bounce
roll
"BEHAVIOUR"

3)HOWDO YOU MAKE OBJECT?


>>First,make a class for each type of object

>>"CLASS IS A 'BLUEPRINT'OF AN OBJECT...."


>>A class is like a rubber stamp!
>> if we stamp somthing it appear physical instance (i.e. object)
>> A Class describes an object
ex: class Ball
String color;
float diameter; ----properties=="DATA MEMBERS"
String brand;
void bounce(float h)
void roll(float d) ---BEHAVIOUR=="MEMBER METHODS"
***Object oriented programming through java
## basic oo concept
>>ENCAPSULATION
>>ABSTRACTION
>>INHERITANCE
>>POLYMORPHISM
OBJECT RELATIONSHIP
> Association-any ("a") relationship(ex:car uses road)
>inheritance-is a relationship
>Aggregation -"has" relationship(ex: 1)car has engine,2)car has tyres)
>Composition- a Stronger "has" relationship
ex;1)A Building has rooms
>Rooms cannot exist without a Building; In other words if Building is removed Ro
oms are also removed(Strong 'HAS' a relation)
First java program
class HelloWorld
{
public static void main(String[] args)
System.out.print("hello");
}
}
VARIABLES,DATA TYPES,EXPRESSIONS
Comments
> using c++ style (//)
> using c style /* gdgsdvhdfvh */
> /** ffjgg,fygyfyg */
Data Types
1) primitive data type
Type

Size

Description

byte
short
int
long

8
16
32
64

bits
bits
bits
bits

"Integers"

float
double

32 bits
64 bits

"floating"
"points"

boolean

1 bit

"true/false"

char

16 bits

"character"

NAMING RULES
> the first character must be a letter,_ or $
>can't be one of the java keywords
DECLARING VARIABLE
>basic unit of storage
>defined by combination of an identifier (name),type & optionally an initial val
ue
1)abstract
5)case
7)char
8)class

JAVA KEYWORDS
2)boolean
3)break
6)catch

4)byte

9)const
10)continue 11)default
13)double 14)else 15)extends
17)final 18)finally 19)float
21)goto 22)if 23)implements
25)inner 26)instanceof 27)int
29)long 30)native 31)new
33)package
34)private 35)protected
37)return

12)do
16)false
20)for
24)import
28)interface
32)null
36)public
38)short

39)static 40)strictfp 41)super


42)switch
43)synchronized 44)this
45)throw
46)throws
47)transient 48)true 49)try
50)void
51)volatile 52)while
AIRTHMETIC OPERATION
operator
+
*
/
%
++
--

description
Addition
Subtraction(also unary negation)
multiplication
Division
modulus
Increment
Decrement
RELATIONAL OPERATORS

operator
<
>
<=
>=
==
!=

description
Less than
greater than
less than or equal to
greater than or equal to
equal to
not equal to

LOGICAL OPERATORS
operator
&
|
^
&&
||
!
==
!=
?:

description
evalution AND
evalution OR
evalution XOR
Logical AND
Logical OR
negation
equal to
not equal to
Conditional

Notes
exclusive OR
shortcut &
shortcut |

Potrebbero piacerti anche