1)What is the value of x after evaluating:
x+ =x+++--x+4;
if x=3,before the evaluation?
2)Evaluate the following Java expressions where a,b,c are integers and d,f are floating point numbers.
The value of a=5,b=3 and d=1.5 .
(a)f =a+b/a
(b)c=d*a+b
(c)c+(a++)*d+a
(d)f=(++b)*b-a
(e)c=a-(b++)*(__d)
3)Illustrate '?' operator.
4)What is the difference between post-increment and pre-increment?If a=4 gives values of ++a and a++.
5)What is the meaning of variable++?
6)What does the following program output to the monitor:
int value=0;
int value=1;
value=count++;
System.out.println("value"+value"+coun...
Can anyone help me in solving this java questions?
Why not type those up into short Java programs and just try them out?
public class prob1
{
public static void main(String[] args) {
int x = 3;
x += x+++-x+4;
System.out.println("x is " + x);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment