-
What is the output of this program?
public class String_Example
{
public static void main(String args[])
{
int ascii[] = { 80, 75, 70, 90};
String obj = new String(ascii, 1, 3);
System.out.println(obj);
}
}
-
- KFZ
- KZF
- FKZ
- ZFK
- ZKF
Correct Option: A
ascii is an array of integers which contains ascii codes of Characters A, B, C, D. String(ascii, 1, 3) is an constructor which initializes obj with Characters corresponding to ascii codes stored in array ascii, starting position being given by 1 & ending position by 3, Thus s stores KFZ.