Wednesday, September 28, 2016

New Operator:-

New operator is used for creating a object to the class. Syntax:- class name obj = new class name(); Eg:- Employee e = new Employee();

Cast Operator:-

It is used to convert the data from one data type to another data type. Eg:- double q = 26.546; int x = (int)a; Lets see a example program on cast operator class Cast { public Static void main(String args[]); { double a = 26.546; System.Out.println("the value of a=" +a); int x=(int)a; System.Out.println("the value of x=" +x); } }

Monday, September 26, 2016


Unary Operator

The Unary Operators are as follows.... => - => ++ => -- We will see a program in JAVA on Unary Operators class Unary { Public Static void main(Sring a[]) { int a=10; System.Out.println("the value of a="+a); System.Out.println("the value of -a="+(-a)); System.Out.println("the value of ++a="+(++a)); System.Out.println("the value of a="+a); System.Out.println("the value of a++="+(a++)); System.Out.println("the value of a="+a); System.Out.println("the value of --a="+(--a)); System.Out.println("the value of a-- ="+(a--)); } } Can anyone predict the output of the program???????? Lets see about the remaining operators in our next post. Have a tremendous Tuesday......

Saturday, September 24, 2016


Increment and Decrement Operator:-

Increment Operator(++) :- ++ is called increment operator and it is increases the
variable by '1'(one). Java is supported to two types of increment operators:- 1) pre increment operator 2) post increment operator Pre increment operator: The ++ is placed before the variable then it is called pre increment operator. Eg:- ++a, ++s Post increment operator: The ++ is placed after the variable then it is called pre increment operator. Eg:- a++, b++ Decrement Operator(++) :- -- is called decrement operator and it is decreases the
variable by '1'(one). Java is supported to two types of increment operators:- 1) pre increment operator 2) post increment operator Pre decrement operator: The -- is placed before the variable then it is called pre increment operator. Eg:- --a, --s Post decrement operator: The -- is placed after the variable then it is called pre increment operator. Eg:- a--, b--

Thursday, September 22, 2016


Boolean Operator:-

The following are the logical operators:- * & * | * ! Boolean AND Truth Table C1 C2 Output True True True False True False True False False False False False From the above table, we understand that the condition 1 and condition 2
are true then the output will be true, otherwise it will be false. Boolean OR Truth Table C1 C2 Output True True True False True True True False True False False False From the above table, we understand that the condition 1 and condition 2
are false then the output will be false, otherwise it will be true. Boolean NOT Truth Table C Output True False False True From the above table, we understand that the condition is true then the output is
false, if the condition is false then the output is true.

Sunday, September 18, 2016


Logical Operator:-

The following are the logical operators:- * && * || * ! Logical AND Truth Table C1 C2 Output True True True False True False True False False False False False From the above table, we understand that the condition 1 and condition 2
are true then the output will be true, otherwise it will be false. Logical OR Truth Table C1 C2 Output True True True False True True True False True False False False From the above table, we understand that the condition 1 and condition 2
are false then the output will be false, otherwise it will be true. Logical NOT Truth Table C Output True False False True From the above table, we understand that the condition is true then the output is
false, if the condition is false then the output is true.

Tuesday, September 13, 2016


Conditional Operator:-

If the condition is true then expression 1 will be executed otherwise
expression 2 will be executed. Syntax:- condition ? exp 1 : exp 2 Lets have a program on Relational Operator class Conditional { Public Static void main(String args[]) { int a=, b=35, max; System.Out.println("the value of a="+a); System.Out.println("the value of b="+b); max= a>b ? a : b; System.Out.println(" max of a,b=" +max); } }

Monday, September 5, 2016


Assignment Operators:-

The assignment operator is = We can assign the value right side of the expression to a left side of the variable is called "Assignment Operator"

Ex :- p = 23 a = 46

Ternary Operators:-

The ternary operator is double equal to(==) Left side of the expression is equivalent to right side of the expression, right expression is equal to left side of the expression. It is known as "ternary operator".

Ex :- s == 2 p == 10

Thursday, September 1, 2016


Relational Operator:-

The following are relational operators..... => < => > => <= => >= => == => != Lets have a program on Relational Operator class Relational { Public Static void main(String args[]) { int a=56, b=35; System.Out.println("the value of a="+a); System.Out.println("the value of b="+b); System.Out.println(a+ "<" +b+ "=" +(a < b)); System.Out.println(a+ ">" +b+ "=" +(a > b)); } }