Computer Applications
Related Questions
How many times will the following loop execute? What value will be returned?
int x = 2; int y = 50; do{ ++x; y -= x++; } while(x <= 10); return y;
Write the output of the following String methods:
(a) "ARTIFICIAL".indexOf('I')
(b) "DOG and PUPPY".trim().length()
Predict the output of the following code snippet:
String a = "20"; String b = "23"; int p = Integer.parseInt(a); int q = Integer.parseInt(b); System.out.print(a + "*" + b);
When there is no explicit initialization, what are the default values set for variables in the following cases?
(a) Integer variable
(b) String variable