A
Q. What will be the output of the following Java program?
class Abc
{
public static void main(String[]args)
{
String[] elements = { "for", "tea", "too" };
String first = (elements.length > 0) ? elements[0]: null;
}
}
- Correct Answer - Option(D)
- Views: 18
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.