SlideShare a Scribd company logo
1 of 41
Download to read offline
By :
Java Operators
The operators in Java are like the following :
1.  Arithme*c	
  operators	
  .	
  
2.  Rela*onal	
  operators.	
  
3.  Logical	
  operators.	
  
4.  Assignment	
  operators.	
  
Arithmetic Operators
Operator	
   Descrip-on	
   Example	
  
+	
   Addi-on	
  –	
  Adds	
  values	
  on	
  either	
  side	
  of	
  the	
  operator	
   A + B will give 30 
-­‐	
   Subtrac-on	
  –	
  Subtracts	
  right	
  hand	
  from	
  le?	
  hand	
  	
   A - B will give -10 
*	
   Mul-plica-on	
  -­‐	
  Mul-plies	
  values	
  on	
  either	
  side	
  of	
  the	
  operator	
  	
   A * B will give 200 
/	
   Division	
  -­‐	
  Divides	
  le?	
  hand	
  operand	
  by	
  right	
  hand	
  operand	
  	
   B / A will give 2 
%	
  
Modulus	
  -­‐	
  Divides	
  le?	
  hand	
  operand	
  by	
  right	
  hand	
  operand	
  and	
  
returns	
  remainder	
  	
  
B % A will give 0 
++	
   Increment	
  -­‐	
  Increases	
  the	
  value	
  of	
  operand	
  by	
  1	
  	
   B++ gives 21 
-­‐-­‐	
   Decrement	
  -­‐	
  Decreases	
  the	
  value	
  of	
  operand	
  by	
  1	
  	
   B-- gives 19 
Arithmetic operators are used in mathematical expressions in the same way that they
are used in algebra.
The following table lists the arithmetic operators:
Assume integer variable A holds 10 and variable B holds 20, then:
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( A + B ) ;
}
010101010101010101010101	
  
30	
  
Addition Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( A - B ) ;
}
010101010101010101010101	
  
-10	
  
Subtraction Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( A * B ) ;
}
010101010101010101010101	
  
200	
  
Multiplication Operators
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( B / A ) ;
}
010101010101010101010101	
  
2	
  
Divition Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( B % A ) ;
}
010101010101010101010101	
  
0	
  
Modulus Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( + + B ) ;
}
010101010101010101010101	
  
Increment Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( + + B ) ;
}
010101010101010101010101	
  
Increment Operator
A=10 B=21
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( + + B ) ;
}
010101010101010101010101	
  
Increment Operator
A=10 B=21
21	
  
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println (B + +) ;
}
010101010101010101010101	
  
20	
  
Increment Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println (B + +) ;
}
010101010101010101010101	
  
20	
  
Increment Operator
A=10 B=21
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( - - B) ;
}
010101010101010101010101	
  
Decrement Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( - - B) ;
}
010101010101010101010101	
  
Decrement Operator
A=10 B=19
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( - - B) ;
}
010101010101010101010101	
  
Decrement Operator
A=10 B=19
19	
  
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( B - - ) ;
}
010101010101010101010101	
  
Decrement Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( B - - ) ;
}
010101010101010101010101	
  
20	
  
Decrement Operator
A=10 B=20
public static void main(String[] args) {
int A , B ;
A=10 ;
B=20 ;
System.out.println ( B - - ) ;
}
010101010101010101010101	
  
20	
  
Decrement Operator
A=10 B=19
Relational Operators
operator	
   Descrip-on	
   Example	
  
==	
  
Checks	
  if	
  the	
  values	
  of	
  two	
  operands	
  are	
  equal	
  or	
  not,	
  if	
  yes	
  then	
  
condi-on	
  becomes	
  true.	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (equal	
  )	
  
(A	
  ==	
  B)	
  is	
  not	
  true.	
  	
  
!=	
  
Checks	
  if	
  the	
  values	
  of	
  two	
  operands	
  are	
  equal	
  or	
  not,	
  if	
  values	
  are	
  not	
  
equal	
  then	
  condi-on	
  becomes	
  true.	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (	
  not	
  equal	
  )	
  
(A	
  !=	
  B)	
  is	
  true.	
  	
  
>	
  
Checks	
  if	
  the	
  value	
  of	
  le?	
  operand	
  is	
  greater	
  than	
  the	
  value	
  of	
  right	
  
operand,	
  if	
  yes	
  then	
  condi-on	
  becomes	
  true.	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (	
  greater	
  than)	
  
(A	
  >	
  B)	
  is	
  not	
  true.	
  	
  
<	
  
Checks	
  if	
  the	
  value	
  of	
  le?	
  operand	
  is	
  less	
  than	
  the	
  value	
  of	
  right	
  operand,	
  
if	
  yes	
  then	
  condi-on	
  becomes	
  true.	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (	
  Less	
  than)	
  
(A	
  <	
  B)	
  is	
  true.	
  	
  
>=	
  
Checks	
  if	
  the	
  value	
  of	
  le?	
  operand	
  is	
  greater	
  than	
  or	
  equal	
  to	
  the	
  value	
  of	
  
right	
  operand,	
  if	
  yes	
  then	
  condi-on	
  becomes	
  true.	
  	
  
(A	
  >=	
  B)	
  is	
  not	
  true.	
  	
  
<=	
  
Checks	
  if	
  the	
  value	
  of	
  le?	
  operand	
  is	
  less	
  than	
  or	
  equal	
  to	
  the	
  value	
  of	
  
right	
  operand,	
  if	
  yes	
  then	
  condi-on	
  becomes	
  true.	
  	
  
(A	
  <=	
  B)	
  is	
  true.	
  	
  
There are following relational operators supported by Java language:
Assume variable A holds 10 and variable B holds 20 , then:
public static void main(String[] args) {
int x , y ;
x = 10 ;
y = 20 ;
System.out.println ( x = = y ) ;
}
010101010101010101010101	
  
False	
  
Relational Operators
x = 10 y = 20
public static void main(String[] args) {
int x , y ;
x = 10 ;
y = 20 ;
System.out.println ( x ! = y ) ;
}
010101010101010101010101	
  
True	
  
Relational Operators
x = 10 y = 20
public static void main(String[] args) {
int x , y ;
x = 10 ;
y = 20 ;
System.out.println ( x > y ) ;
}
010101010101010101010101	
  
False	
  
Relational Operators
x = 10 y = 20
public static void main(String[] args) {
int x , y ;
x = 10 ;
y = 20 ;
System.out.println ( x < y ) ;
}
010101010101010101010101	
  
True	
  
Relational Operators
x = 10 y = 20
public static void main(String[] args) {
int x , y ;
x = 10 ;
y = 20 ;
System.out.println ( x > = y ) ;
}
010101010101010101010101	
  
False	
  
Relational Operators
x = 10 y = 20
public static void main(String[] args) {
int x , y ;
x = 10 ;
y = 20 ;
System.out.println ( x < = y ) ;
}
010101010101010101010101	
  
True	
  
Relational Operators
x = 10 y = 20
Logical Operators
Operator	
   Descrip-on	
   Example	
  
&&	
  
Called	
  Logical	
  AND	
  operator.	
  If	
  both	
  the	
  operands	
  
are	
  non-­‐zero,	
  then	
  the	
  condi-on	
  becomes	
  true.	
  	
  
(A	
  &&	
  B)	
  is	
  false.	
  	
  
||	
  
Called	
   Logical	
   OR	
   Operator.	
   If	
   any	
   of	
   the	
   two	
  
operands	
  are	
  non-­‐zero,	
  then	
  the	
  condi-on	
  becomes	
  
true.	
  	
  
(A	
  ||	
  B)	
  is	
  true.	
  	
  
!	
  
Called	
   Logical	
   NOT	
   Operator.	
   Use	
   to	
   reverses	
   the	
  
logical	
  state	
  of	
  its	
  operand.	
  If	
  a	
  condi-on	
  is	
  true	
  then	
  
Logical	
  NOT	
  operator	
  will	
  make	
  false.	
  	
  
!(A	
  &&	
  B)	
  is	
  true.	
  	
  
The following table lists the logical operators:
Assume Boolean variables A holds true and variable B holds false , then:
public static void main(String[] args) {
int test = 6 ;
If ( test = = 9 ) {
System.out.println( “ yes ” ) ;
} else {
System.out.println( “ this is else ” ) ;
}
}
010101010101010101010101	
  
this is else 	
  
If Statement
test = 6
public static void main(String[] args) {
int boy , girl ;
boy = 18 ;
girl = 68 ;
If ( boy > 10 ) {
System.out.println(“you can enter”) ;
}else{
System.out.println(“you are too young”)
}
}
010101010101010101010101	
  
You can enter	
  
Logical Operators
boy = 18 girl = 68
public static void main(String[] args) {
int boy , girl ;
boy = 18 ;
girl = 68 ;
If ( boy > 10 && girl < 60 ) {
System.out.println(“you can enter”) ;
}else{
System.out.println(“you are too young”);
}
}
010101010101010101010101	
  
You are too young	
  
Logical Operators
boy = 18 girl = 68
public static void main(String[] args) {
int boy , girl ;
boy = 18 ;
girl = 68 ;
If ( boy > 10 | | girl < 60 ) {
System.out.println(“you can enter”) ;
}else{
System.out.println(“you are too young”);
}
}
010101010101010101010101	
  
You can enter	
  
Logical Operators
boy = 18 girl = 68
public static void main(String[] args) {
int boy , girl ;
boy = 18 ;
girl = 68 ;
If (!( boy > 10 && girl < 60 )) {
System.out.println(“you can enter”) ;
}else{
System.out.println(“you are too young”);
}
}
010101010101010101010101	
  
you can enter	
  
Logical Operators
boy = 18 girl = 68
public static void main(String[] args) {
int age ;
age = 3 ;
Switch( age ) {
case1 :
System.out.println(“you can crawl”) ;
break ;
case2 :
System.out.println(“you can talk”) ;
break ;
case3 :
System.out.println(“you can get in trouble”) ;
break ;
default :
System.out.println(“I don’t know how old are you”)
}
010101010101010101010101	
  
you can get in trouble	
  
Logical Operators
age= 3
Assignment Operators
Operator	
   Descrip-on	
   Example	
  
=	
  
Simple	
   assignment	
   operator,	
   Assigns	
   values	
   from	
  
right	
  side	
  operands	
  to	
  le?	
  side	
  operand	
  	
  
C	
  =	
  A	
  +	
  B	
  will	
  assign	
  value	
  of	
  	
  
A	
  +	
  B	
  into	
  C	
  	
  
+=	
  
Add	
  AND	
  assignment	
  operator,	
  It	
  adds	
  right	
  operand	
  
to	
   the	
   le?	
   operand	
   and	
   assign	
   the	
   result	
   to	
   le?	
  
operand	
  
C	
  +=	
  A	
  is	
  equivalent	
  to	
  C	
  =	
  C	
  +	
  A	
  
-­‐=	
  
Subtract	
  AND	
  assignment	
  operator,	
  It	
  subtracts	
  right	
  
operand	
  from	
  the	
  le?	
  operand	
  and	
  assign	
  the	
  result	
  
to	
  le?	
  operand	
  	
  
C	
  -­‐=	
  A	
  is	
  equivalent	
  to	
  C	
  =	
  C	
  -­‐	
  A	
  	
  
*=	
  
Mul-ply	
   AND	
   assignment	
   operator,	
   It	
   mul-plies	
  
right	
  operand	
  with	
  the	
  le?	
  operand	
  and	
  assign	
  the	
  
result	
  to	
  le?	
  operand	
  	
  
C	
  *=	
  A	
  is	
  equivalent	
  to	
  C	
  =	
  C	
  *	
  A	
  	
  
/=	
  
Divide	
   AND	
   assignment	
   operator,	
   It	
   divides	
   le?	
  
operand	
  with	
  the	
  right	
  operand	
  and	
  assign	
  the	
  result	
  
to	
  le?	
  operand	
  	
  
	
  
C	
  /=	
  A	
  is	
  equivalent	
  to	
  C	
  =	
  C	
  /	
  A	
  
%=	
  
Modulus	
   AND	
   assignment	
   operator,	
   It	
   takes	
  
modulus	
  using	
  two	
  operands	
  and	
  assign	
  the	
  result	
  to	
  
le?	
  operand	
  
C	
  %=	
  A	
  is	
  equivalent	
  to	
  C	
  =	
  C	
  %	
  A	
  	
  
public static void main(String[] args) {
int a , b , c ;
a = 10 ;
b = 20 ;
c = 0 ;
c = a + b ;
System.out.println (c) ;
}
010101010101010101010101	
  
30	
  
Assignment Operators
a = 10 b = 20 c = 0
public static void main(String[] args) {
int a , b , c ;
a = 10 ;
b = 20 ;
c = 0 ;
c + = a ;
System.out.println (c) ;
}
010101010101010101010101	
  
10	
  
Assignment Operators
a = 10 b = 20 c = 0
public static void main(String[] args) {
int a , b , c ;
a = 10 ;
b = 20 ;
c = 0 ;
c - = a ;
System.out.println (c) ;
}
010101010101010101010101	
  
-10	
  
Assignment Operators
a = 10 b = 20 c = 0
public static void main(String[] args) {
int a , b , c ;
a = 10 ;
b = 20 ;
c = 0 ;
c*=a ;
System.out.println (c) ;
}
010101010101010101010101	
  
0	
  
Assignment Operators
a = 10 b = 20 c = 0
public static void main(String[] args) {
int a , b , c ;
a = 10 ;
b = 20 ;
c = 0 ;
c/=a ;
System.out.println (c) ;
}
010101010101010101010101	
  
0	
  
Assignment Operators
a = 10 b = 20 c = 0
public static void main(String[] args) {
int a , b , c ;
a = 10 ;
b = 20 ;
c = 0 ;
c%=a ;
System.out.println (c) ;
}
010101010101010101010101	
  
0	
  
Assignment Operators
a = 10 b = 20 c = 0
Assignment
.٢٥ ، ٢٠ ، ٣٠ : ‫التالية‬ ‫الدرجات‬ ‫مجموع‬ ‫بحساب‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ -
. ٧/٢ : ‫قسمة‬ ‫باقي‬ ‫بمعرفة‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ -
. ‫راسب‬ ‫او‬ ‫ناجح‬ ‫الطالب‬ ‫كان‬ ‫إذا‬ ‫بمعرفة‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ -
) ‫قيمة‬ ‫بطباعة‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ -X. ‫الذاكرة‬ ‫في‬ (١ ) ‫بــ‬ ‫القيمة‬ ‫هذه‬ ‫تزويد‬ ‫ذلك‬ ‫بعد‬ ‫ثم‬ ً ‫اوال‬ (
) ‫قيمة‬ ‫بنقص‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ -A) ‫قيمة‬ ‫طباعة‬ ‫ذلك‬ ‫بعد‬ ‫ثم‬ ، ‫الذاكرة‬ ‫من‬ (١) ‫بـ‬ (A. (
) ‫بطباعة‬ ‫يقوم‬ ‫برنامج‬ ‫ اكتب‬ -Excellent)‫وطباعة‬ (٩٠ =< X ) ‫كان‬ ‫إذا‬ (Very Good‫(إذا‬
) ‫وطباعة‬ ( ٨٠ =< X ) ‫كان‬Good) ‫وطباعـــــــــــــــة‬ (٥٠ =< X ) ‫كان‬ ‫(إذا‬Fail‫إذا‬ (
.(٥٠ => X ) ‫كان‬

More Related Content

What's hot

ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaWiem Zine Elabidine
 
Operators and Expression
Operators and ExpressionOperators and Expression
Operators and Expressionshubham_jangid
 
Mesics lecture 4 c operators and experssions
Mesics lecture  4   c operators and experssionsMesics lecture  4   c operators and experssions
Mesics lecture 4 c operators and experssionseShikshak
 
Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in JavaAbhilash Nair
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++Neeru Mittal
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming Kamal Acharya
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Himanshu Kaushik
 
Cis 115 Enhance teaching / snaptutorial.com
Cis 115  Enhance teaching / snaptutorial.comCis 115  Enhance teaching / snaptutorial.com
Cis 115 Enhance teaching / snaptutorial.comHarrisGeorg51
 
Cis 115 Education Organization -- snaptutorial.com
Cis 115   Education Organization -- snaptutorial.comCis 115   Education Organization -- snaptutorial.com
Cis 115 Education Organization -- snaptutorial.comDavisMurphyB99
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operatorsdishti7
 
CIS 115 Exceptional Education - snaptutorial.com
CIS 115   Exceptional Education - snaptutorial.comCIS 115   Exceptional Education - snaptutorial.com
CIS 115 Exceptional Education - snaptutorial.comDavisMurphyB33
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++Praveen M Jigajinni
 
Expressions in c++
 Expressions in c++ Expressions in c++
Expressions in c++zeeshan turi
 
Operators In Java Part - 8
Operators In Java Part - 8Operators In Java Part - 8
Operators In Java Part - 8MuhammadAtif231
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.comBaileyao
 

What's hot (20)

C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in Scala
 
6 operators-in-c
6 operators-in-c6 operators-in-c
6 operators-in-c
 
Operators and Expression
Operators and ExpressionOperators and Expression
Operators and Expression
 
Mesics lecture 4 c operators and experssions
Mesics lecture  4   c operators and experssionsMesics lecture  4   c operators and experssions
Mesics lecture 4 c operators and experssions
 
Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in Java
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++
 
Cis 115 Enhance teaching / snaptutorial.com
Cis 115  Enhance teaching / snaptutorial.comCis 115  Enhance teaching / snaptutorial.com
Cis 115 Enhance teaching / snaptutorial.com
 
Cis 115 Education Organization -- snaptutorial.com
Cis 115   Education Organization -- snaptutorial.comCis 115   Education Organization -- snaptutorial.com
Cis 115 Education Organization -- snaptutorial.com
 
Operators in Java
Operators in JavaOperators in Java
Operators in Java
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
CIS 115 Exceptional Education - snaptutorial.com
CIS 115   Exceptional Education - snaptutorial.comCIS 115   Exceptional Education - snaptutorial.com
CIS 115 Exceptional Education - snaptutorial.com
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
Expressions in c++
 Expressions in c++ Expressions in c++
Expressions in c++
 
Operators In Java Part - 8
Operators In Java Part - 8Operators In Java Part - 8
Operators In Java Part - 8
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.com
 
C operator and expression
C operator and expressionC operator and expression
C operator and expression
 

Viewers also liked

Advance mathematics mid term presentation rev01
Advance mathematics mid term presentation rev01Advance mathematics mid term presentation rev01
Advance mathematics mid term presentation rev01Nirmal Joshi
 
Pamela bustos- pe
Pamela bustos- pePamela bustos- pe
Pamela bustos- pe8280709990
 
LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...
LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...
LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...LiveXchange Conference
 
LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...
LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...
LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...LiveXchange Conference
 
TBLT research article _Carless 2004
TBLT research article _Carless 2004TBLT research article _Carless 2004
TBLT research article _Carless 2004eunhee kim
 
CMD Command prompts
CMD Command promptsCMD Command prompts
CMD Command promptsAhmed Hesham
 

Viewers also liked (12)

Tania ulpo-pe
Tania ulpo-peTania ulpo-pe
Tania ulpo-pe
 
Advance mathematics mid term presentation rev01
Advance mathematics mid term presentation rev01Advance mathematics mid term presentation rev01
Advance mathematics mid term presentation rev01
 
Pamela bustos- pe
Pamela bustos- pePamela bustos- pe
Pamela bustos- pe
 
Nepal adventure
Nepal adventureNepal adventure
Nepal adventure
 
LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...
LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...
LiveXChange Conference 2013 Animal Welfare Session Dr Leisha Hewitt- Guidelin...
 
Part 2
Part 2Part 2
Part 2
 
LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...
LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...
LiveXChange Conference 2013 Animal Welfare Session Dr Derek Belton- Animal we...
 
TBLT research article _Carless 2004
TBLT research article _Carless 2004TBLT research article _Carless 2004
TBLT research article _Carless 2004
 
Blog (1)
Blog (1)Blog (1)
Blog (1)
 
TPACK Reflection
TPACK ReflectionTPACK Reflection
TPACK Reflection
 
Operating system
Operating systemOperating system
Operating system
 
CMD Command prompts
CMD Command promptsCMD Command prompts
CMD Command prompts
 

Similar to Java 2

Similar to Java 2 (20)

Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
Programming C Part 02
Programming C Part 02Programming C Part 02
Programming C Part 02
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
java operators
 java operators java operators
java operators
 
05 operators
05   operators05   operators
05 operators
 
11operator in c#
11operator in c#11operator in c#
11operator in c#
 
Bit shift operators
Bit shift operatorsBit shift operators
Bit shift operators
 
5_Operators.pdf
5_Operators.pdf5_Operators.pdf
5_Operators.pdf
 
Session03 operators
Session03 operatorsSession03 operators
Session03 operators
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 
C operators
C operatorsC operators
C operators
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Java - Operators
Java - OperatorsJava - Operators
Java - Operators
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
 
Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.ppt
 
Introduction to JavaScript Scripting Language
Introduction to JavaScript Scripting LanguageIntroduction to JavaScript Scripting Language
Introduction to JavaScript Scripting Language
 
itft-Operators in java
itft-Operators in javaitft-Operators in java
itft-Operators in java
 
COM1407: C Operators
COM1407: C OperatorsCOM1407: C Operators
COM1407: C Operators
 
Theory3
Theory3Theory3
Theory3
 

Recently uploaded

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 

Recently uploaded (20)

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 

Java 2

  • 2. Java Operators The operators in Java are like the following : 1.  Arithme*c  operators  .   2.  Rela*onal  operators.   3.  Logical  operators.   4.  Assignment  operators.  
  • 3. Arithmetic Operators Operator   Descrip-on   Example   +   Addi-on  –  Adds  values  on  either  side  of  the  operator   A + B will give 30 -­‐   Subtrac-on  –  Subtracts  right  hand  from  le?  hand     A - B will give -10 *   Mul-plica-on  -­‐  Mul-plies  values  on  either  side  of  the  operator     A * B will give 200 /   Division  -­‐  Divides  le?  hand  operand  by  right  hand  operand     B / A will give 2 %   Modulus  -­‐  Divides  le?  hand  operand  by  right  hand  operand  and   returns  remainder     B % A will give 0 ++   Increment  -­‐  Increases  the  value  of  operand  by  1     B++ gives 21 -­‐-­‐   Decrement  -­‐  Decreases  the  value  of  operand  by  1     B-- gives 19 Arithmetic operators are used in mathematical expressions in the same way that they are used in algebra. The following table lists the arithmetic operators: Assume integer variable A holds 10 and variable B holds 20, then:
  • 4. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( A + B ) ; } 010101010101010101010101   30   Addition Operator A=10 B=20
  • 5. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( A - B ) ; } 010101010101010101010101   -10   Subtraction Operator A=10 B=20
  • 6. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( A * B ) ; } 010101010101010101010101   200   Multiplication Operators A=10 B=20
  • 7. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( B / A ) ; } 010101010101010101010101   2   Divition Operator A=10 B=20
  • 8. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( B % A ) ; } 010101010101010101010101   0   Modulus Operator A=10 B=20
  • 9. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( + + B ) ; } 010101010101010101010101   Increment Operator A=10 B=20
  • 10. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( + + B ) ; } 010101010101010101010101   Increment Operator A=10 B=21
  • 11. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( + + B ) ; } 010101010101010101010101   Increment Operator A=10 B=21 21  
  • 12. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println (B + +) ; } 010101010101010101010101   20   Increment Operator A=10 B=20
  • 13. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println (B + +) ; } 010101010101010101010101   20   Increment Operator A=10 B=21
  • 14. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( - - B) ; } 010101010101010101010101   Decrement Operator A=10 B=20
  • 15. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( - - B) ; } 010101010101010101010101   Decrement Operator A=10 B=19
  • 16. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( - - B) ; } 010101010101010101010101   Decrement Operator A=10 B=19 19  
  • 17. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( B - - ) ; } 010101010101010101010101   Decrement Operator A=10 B=20
  • 18. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( B - - ) ; } 010101010101010101010101   20   Decrement Operator A=10 B=20
  • 19. public static void main(String[] args) { int A , B ; A=10 ; B=20 ; System.out.println ( B - - ) ; } 010101010101010101010101   20   Decrement Operator A=10 B=19
  • 20. Relational Operators operator   Descrip-on   Example   ==   Checks  if  the  values  of  two  operands  are  equal  or  not,  if  yes  then   condi-on  becomes  true.                    (equal  )   (A  ==  B)  is  not  true.     !=   Checks  if  the  values  of  two  operands  are  equal  or  not,  if  values  are  not   equal  then  condi-on  becomes  true.                          (  not  equal  )   (A  !=  B)  is  true.     >   Checks  if  the  value  of  le?  operand  is  greater  than  the  value  of  right   operand,  if  yes  then  condi-on  becomes  true.                            (  greater  than)   (A  >  B)  is  not  true.     <   Checks  if  the  value  of  le?  operand  is  less  than  the  value  of  right  operand,   if  yes  then  condi-on  becomes  true.                                            (  Less  than)   (A  <  B)  is  true.     >=   Checks  if  the  value  of  le?  operand  is  greater  than  or  equal  to  the  value  of   right  operand,  if  yes  then  condi-on  becomes  true.     (A  >=  B)  is  not  true.     <=   Checks  if  the  value  of  le?  operand  is  less  than  or  equal  to  the  value  of   right  operand,  if  yes  then  condi-on  becomes  true.     (A  <=  B)  is  true.     There are following relational operators supported by Java language: Assume variable A holds 10 and variable B holds 20 , then:
  • 21. public static void main(String[] args) { int x , y ; x = 10 ; y = 20 ; System.out.println ( x = = y ) ; } 010101010101010101010101   False   Relational Operators x = 10 y = 20
  • 22. public static void main(String[] args) { int x , y ; x = 10 ; y = 20 ; System.out.println ( x ! = y ) ; } 010101010101010101010101   True   Relational Operators x = 10 y = 20
  • 23. public static void main(String[] args) { int x , y ; x = 10 ; y = 20 ; System.out.println ( x > y ) ; } 010101010101010101010101   False   Relational Operators x = 10 y = 20
  • 24. public static void main(String[] args) { int x , y ; x = 10 ; y = 20 ; System.out.println ( x < y ) ; } 010101010101010101010101   True   Relational Operators x = 10 y = 20
  • 25. public static void main(String[] args) { int x , y ; x = 10 ; y = 20 ; System.out.println ( x > = y ) ; } 010101010101010101010101   False   Relational Operators x = 10 y = 20
  • 26. public static void main(String[] args) { int x , y ; x = 10 ; y = 20 ; System.out.println ( x < = y ) ; } 010101010101010101010101   True   Relational Operators x = 10 y = 20
  • 27. Logical Operators Operator   Descrip-on   Example   &&   Called  Logical  AND  operator.  If  both  the  operands   are  non-­‐zero,  then  the  condi-on  becomes  true.     (A  &&  B)  is  false.     ||   Called   Logical   OR   Operator.   If   any   of   the   two   operands  are  non-­‐zero,  then  the  condi-on  becomes   true.     (A  ||  B)  is  true.     !   Called   Logical   NOT   Operator.   Use   to   reverses   the   logical  state  of  its  operand.  If  a  condi-on  is  true  then   Logical  NOT  operator  will  make  false.     !(A  &&  B)  is  true.     The following table lists the logical operators: Assume Boolean variables A holds true and variable B holds false , then:
  • 28. public static void main(String[] args) { int test = 6 ; If ( test = = 9 ) { System.out.println( “ yes ” ) ; } else { System.out.println( “ this is else ” ) ; } } 010101010101010101010101   this is else   If Statement test = 6
  • 29. public static void main(String[] args) { int boy , girl ; boy = 18 ; girl = 68 ; If ( boy > 10 ) { System.out.println(“you can enter”) ; }else{ System.out.println(“you are too young”) } } 010101010101010101010101   You can enter   Logical Operators boy = 18 girl = 68
  • 30. public static void main(String[] args) { int boy , girl ; boy = 18 ; girl = 68 ; If ( boy > 10 && girl < 60 ) { System.out.println(“you can enter”) ; }else{ System.out.println(“you are too young”); } } 010101010101010101010101   You are too young   Logical Operators boy = 18 girl = 68
  • 31. public static void main(String[] args) { int boy , girl ; boy = 18 ; girl = 68 ; If ( boy > 10 | | girl < 60 ) { System.out.println(“you can enter”) ; }else{ System.out.println(“you are too young”); } } 010101010101010101010101   You can enter   Logical Operators boy = 18 girl = 68
  • 32. public static void main(String[] args) { int boy , girl ; boy = 18 ; girl = 68 ; If (!( boy > 10 && girl < 60 )) { System.out.println(“you can enter”) ; }else{ System.out.println(“you are too young”); } } 010101010101010101010101   you can enter   Logical Operators boy = 18 girl = 68
  • 33. public static void main(String[] args) { int age ; age = 3 ; Switch( age ) { case1 : System.out.println(“you can crawl”) ; break ; case2 : System.out.println(“you can talk”) ; break ; case3 : System.out.println(“you can get in trouble”) ; break ; default : System.out.println(“I don’t know how old are you”) } 010101010101010101010101   you can get in trouble   Logical Operators age= 3
  • 34. Assignment Operators Operator   Descrip-on   Example   =   Simple   assignment   operator,   Assigns   values   from   right  side  operands  to  le?  side  operand     C  =  A  +  B  will  assign  value  of     A  +  B  into  C     +=   Add  AND  assignment  operator,  It  adds  right  operand   to   the   le?   operand   and   assign   the   result   to   le?   operand   C  +=  A  is  equivalent  to  C  =  C  +  A   -­‐=   Subtract  AND  assignment  operator,  It  subtracts  right   operand  from  the  le?  operand  and  assign  the  result   to  le?  operand     C  -­‐=  A  is  equivalent  to  C  =  C  -­‐  A     *=   Mul-ply   AND   assignment   operator,   It   mul-plies   right  operand  with  the  le?  operand  and  assign  the   result  to  le?  operand     C  *=  A  is  equivalent  to  C  =  C  *  A     /=   Divide   AND   assignment   operator,   It   divides   le?   operand  with  the  right  operand  and  assign  the  result   to  le?  operand       C  /=  A  is  equivalent  to  C  =  C  /  A   %=   Modulus   AND   assignment   operator,   It   takes   modulus  using  two  operands  and  assign  the  result  to   le?  operand   C  %=  A  is  equivalent  to  C  =  C  %  A    
  • 35. public static void main(String[] args) { int a , b , c ; a = 10 ; b = 20 ; c = 0 ; c = a + b ; System.out.println (c) ; } 010101010101010101010101   30   Assignment Operators a = 10 b = 20 c = 0
  • 36. public static void main(String[] args) { int a , b , c ; a = 10 ; b = 20 ; c = 0 ; c + = a ; System.out.println (c) ; } 010101010101010101010101   10   Assignment Operators a = 10 b = 20 c = 0
  • 37. public static void main(String[] args) { int a , b , c ; a = 10 ; b = 20 ; c = 0 ; c - = a ; System.out.println (c) ; } 010101010101010101010101   -10   Assignment Operators a = 10 b = 20 c = 0
  • 38. public static void main(String[] args) { int a , b , c ; a = 10 ; b = 20 ; c = 0 ; c*=a ; System.out.println (c) ; } 010101010101010101010101   0   Assignment Operators a = 10 b = 20 c = 0
  • 39. public static void main(String[] args) { int a , b , c ; a = 10 ; b = 20 ; c = 0 ; c/=a ; System.out.println (c) ; } 010101010101010101010101   0   Assignment Operators a = 10 b = 20 c = 0
  • 40. public static void main(String[] args) { int a , b , c ; a = 10 ; b = 20 ; c = 0 ; c%=a ; System.out.println (c) ; } 010101010101010101010101   0   Assignment Operators a = 10 b = 20 c = 0
  • 41. Assignment .٢٥ ، ٢٠ ، ٣٠ : ‫التالية‬ ‫الدرجات‬ ‫مجموع‬ ‫بحساب‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ - . ٧/٢ : ‫قسمة‬ ‫باقي‬ ‫بمعرفة‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ - . ‫راسب‬ ‫او‬ ‫ناجح‬ ‫الطالب‬ ‫كان‬ ‫إذا‬ ‫بمعرفة‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ - ) ‫قيمة‬ ‫بطباعة‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ -X. ‫الذاكرة‬ ‫في‬ (١ ) ‫بــ‬ ‫القيمة‬ ‫هذه‬ ‫تزويد‬ ‫ذلك‬ ‫بعد‬ ‫ثم‬ ً ‫اوال‬ ( ) ‫قيمة‬ ‫بنقص‬ ‫يقوم‬ ‫برنامج‬ ‫ أكتب‬ -A) ‫قيمة‬ ‫طباعة‬ ‫ذلك‬ ‫بعد‬ ‫ثم‬ ، ‫الذاكرة‬ ‫من‬ (١) ‫بـ‬ (A. ( ) ‫بطباعة‬ ‫يقوم‬ ‫برنامج‬ ‫ اكتب‬ -Excellent)‫وطباعة‬ (٩٠ =< X ) ‫كان‬ ‫إذا‬ (Very Good‫(إذا‬ ) ‫وطباعة‬ ( ٨٠ =< X ) ‫كان‬Good) ‫وطباعـــــــــــــــة‬ (٥٠ =< X ) ‫كان‬ ‫(إذا‬Fail‫إذا‬ ( .(٥٠ => X ) ‫كان‬