| Author |
about primitive
|
Sundar Murthi
Ranch Hand
Joined: Mar 05, 2004
Posts: 209
|
|
Hi... I am confused with the output of the following method output any one explain to me What will happen when you invoke the following method? Options : a . The loop never ends ( infinite loop ) . b . Prints " Welcome to Java " to the console c . Compilation error at line 5. ++ operator should not be used for byte type variables. d . Prints nothing but terminates after some time Ans given as b what happens when b reaches maximum value? thanks in advance.
|
 |
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
|
|
Please try to search for recent posts on the same question. Thanks
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
K Patel
Greenhorn
Joined: Mar 29, 2004
Posts: 7
|
|
|
The print statements not in the while loop. And I byte will reset from 127 to -128 because the the byte will have a leading 1 now.
|
 |
Sundar Murthi
Ranch Hand
Joined: Mar 05, 2004
Posts: 209
|
|
|
Thanks Gaunt and Patel
|
 |
 |
|
|
subject: about primitive
|
|
|