Computer Applications
Give the output of the following program segment:
int x[] = {4, 3, 7, 8, 9, 10};
int p = x.length;
int q = x[2] + x[5] * x[1];
System.out.println("p=" + p);
System.out.println("q=" + q);
Related Questions
The statement used to find the total number of Strings present in the string array String s[] is:
- s.length
- s.length()
- length(s)
- len(s)
What is the output of the Java code given below?
String color[] = {"Blue", "Red", "Violet"}; System.out.println(color[2].length());- 6
- 5
- 3
- 2
A single dimensional array has 50 elements, which of the following is the correct statement to initialize the last element to 100.
- x[51]=100
- x[48]=100
- x[49]=100
- x[50]=100