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...
I'll be very thankful to you..
Can anyone help me in solving this java questions?
Pained though I am to complete your homework for you, here are the answers (minus the explanation):
1. 13
2. 5.6, 16.5, 13.5, 11, 3.5 (assuming that you copied questions c and e incorrectly)
3. see http://java.sun.com/docs/books/tutorial/...
4. 5 and 4. See if you can tell the difference.
5. If you can't answer this, you're in the wrong class
6. It gives a compile-time error.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment