0 - Javamcq Part1 36
0 - Javamcq Part1 36
a) row
b) column
c) both row and column
d) none of the mentioned
answer: a
34-what will be the output of the following java code?
Class array_output
{
public static void main(String args[])
{
int array_variable [] = new int[10];
for (int i = 0; i < 10; ++i)
{
array_variable[i] = i;
system.out.print(array_variable[i] + " ");
i++;
}
}
}
a) 0 2 4 6 8
b) 1 3 5 7 9
c) 0 1 2 3 4 5 6 7 8 9
d) 1 2 3 4 5 6 7 8 9 10
ans: a
35-what will be the output of the following java code?
Class evaluate
{
public static void main(String args[])
{
int arr[] = new int[] {0 , 1, 2, 3, 4, 5, 6, 7, 8, 9};
int n = 6;
n = arr[arr[n] / 2];
system.out.println(arr[n] / 2);
}
}
a) 3
b) 0
c) 6
d) 1
ans: d
36-what will be the output of the following java code?
Class array_output
{
public static void main(String args[])
{
char array_variable [] = new char[10];
for (int i = 0; i < 10; ++i)
{