·
Java increment and decrement operator
Q.1] Type of increment operator and its syntax:-
·
Increment [ syntax:-{ ++}]
Q.2 ] Type of decrement operator and its syntax:-
·
decrement [ syntax:-{ --}]
Q.3 write a
program to increment operator?
class Increment
{
public static void
main(String args[]) {
int a=5;
a++;
System.out.println(a);
}
}
Q.2] write a program to increment operator?
class Decrement
{
public static void
main(String args[]) {
int a=50;
a--;
System.out.println(a);
}
}
0 Comments