Computer Applications
Find the output of the following program snippet:
String s= "7";
int t =Integer.parseInt(s);
t=t+1000;
System.out.println(t);
Java
Java Library Classes
49 Likes
Answer
1007
Working
Integer.parseInt()
converts "7" into an int
value i.e. the decimal number 7. t+1000
adds the number 7 to 1000 giving 1007 as the output.
Answered By
33 Likes
Related Questions
Find the output of the following program snippet:
char ch = '*'; boolean b = Character.isLetter(ch); System.out.println(b);
Find the output of the following program snippet:
char c = 'A'; int n = (int) c + 32; System.out.println((char)n);
Find the output of the following program snippet:
char c = 'B'; int i = 4; System.out.println(c+i); System.out.println((int)c+i);
Find the output of the following program snippet:
char ch = 'y'; char chr = Character.toUpperCase(ch); int p = (int) chr; System.out.println(chr + "\t" + p);