Java

60
2194 reads

February 9, 2013

Comparison of integer values


It illustrates the usage of comparison operators on integer data type values.

56
2276 reads

February 9, 2013

Logical Operators on Boolean values


Boolean values can hold any either of these values: true or false.
Logical Or gives true if either of the operands is true. Or even when both are true. Else, its false.

56
2436 reads

February 9, 2013

ArithmeticOperators on integer


This example illustrates all the arithmetic operators and how they work on integer variables.

38
2318 reads

February 9, 2013

Student class example


Here we make a example for a class called Student. And some basic accessor and mutator methods

56
2476 reads

February 8, 2013

Ternary Operator


Ternary Operator(?:) is an alternative to a simple if else statement.
Like in if-else we check for certain condition and make statement execute according to
result.

49
2400 reads

February 8, 2013

Shorthand Operators


Shorthand Operators

Java provides special operators that can be used to combine an arithmetic operation with an assignment.

Like if we have a statement like following statement
a=a+4;

57
2337 reads

February 8, 2013

Unary Operator


The ++ and the -- are java's increment and decrement.
The increment operator increases its operand by one.
While decrement operator decreases its operand by one.

26
2421 reads

February 8, 2013

Expression Evauation


This example illustrates the evaluation of arithmetic expression based on associativity of operators.

314
4034 reads

February 8, 2013

Class Member Access (Dot) Operator


Special Operator called Dot Operator in Java:-

"The dot" connects classes and objects to members.
The places where you use it in what I cover are:

188
2602 reads

February 8, 2013

Binary Operator


String Concatenation:-

This binary operator will concatenate one string to another.

Example:

String str1 = "abc";
String str2 = "def";
String str3 = str1 + str2