MCQOPTIONS
Bookmark
Saved Bookmarks
→
Java Programming
→
Exceptions
→
What will this code print?
1.
What will this code print?
A.
[I@2a139a55
B.
Runtime Error
C.
0 0 0 0 0 0 0
D.
Compilation error
E.
None of these
Answer» B. Runtime Error
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
What is the output of this program?import java.util.*; public class ArrayExample { public static void main(String args[]) { int arr[] = new int [10]; for (int k = 10; k > 0; k--) arr[10 - k] = k; Arrays.sort(arr); for (int k = 0; k < 7; ++k) System.out.print(arr[k]); } }
What will this code print?public class array { public static void main(String args[]) { int arr[] = new int [7]; System.out.print(arr); } }
What is the output of this program?public class arr_output { public static void main(String args[]) { char arr_var [] = new char[10]; for (int i = 0; i < 5; ++i) { arr_var[i] = 'K'; System.out.print(arr_var[i] + " "); } } }
What is the output of this program?public class output { public static void main(String args[]) { int array[] = new int[] {0 , 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int num = 10; num = array[array[num] / 2]; System.out.println(array[num] / 2); } }
What is the output of this program?public class multidimention_arr { public static void main(String args[]) { int array[][] = new int[5][5]; array[0] = new int[1]; array[1] = new int[2]; array[2] = new int[3]; int sum = 0; for (int i = 0; i < 5; ++i) { for (int j = 0; j < i + 1; ++j) { array[i][j] = j + 1; } } for (int i = 0; i < 5; ++i) { for (int j = 0; j < i + 1; ++j) { sum = sum + array[i][j]; } } System.out.print(sum); } }
What is the output of this program?public class arr_output { public static void main(String args[]) { int arr_var [] = new int[20]; for (int j = 0; j < 20; ++j) { arr_var[j] = j; System.out.print(arr_var[j] + " "); j++; } } }
What is the output of below snippet?Obj[] names = new String[10];name[0] = new Integer(0);
What will this code print?int a[] = new int [10];System.out.print(a);
What is the type of variable b and d in the below snippet?int a[], b;int []c, d;
What is the output of this program?public class arr_output { public static void main(String args[]) { int arr_var[][] = {{ 1, 2, 3, 4}, { 4 , 5, 6, 7}, { 7, 8, 9, 10}}; int sum = 0; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3 ; ++j) { sum = sum + arr_var[i][j]; } } System.out.print(sum / 2); } }
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies