Skip to content

Tag Archives: Java-Arrays

Output of following Java program? class Test {     public static void main (String[] args)      {         int arr1[] = {1, 2, 3};         int arr2[] = {1,… Read More
public class Main {     public static void main(String args[]) {         int arr[][] = new int[4][];         arr[0] = new int[1];         arr[1] = new int[2];         arr[2] =… Read More
class Test {    public static void main(String args[]) {      int arr[] = new int[2];        System.out.println(arr[0]);      System.out.println(arr[1]);    } } (A) 0 0 (B) garbage value garbage… Read More
class Test {    public static void main(String args[]) {      int arr[2];        System.out.println(arr[0]);      System.out.println(arr[1]);    } } (A) 0 0 (B) garbage value garbage value (C) Compiler… Read More
Predict the output of following Java program. class Test {     public static void main (String[] args)      {         int arr1[] = {1, 2, 3};         int arr2[]… Read More
Predict the output? // file name: Main.java public class Main {     public static void main(String args[]) {        int arr[] = {10, 20, 30, 40, 50};… Read More
Which of the following is FALSE about arrays on Java (A) A java array is always an object (B) Length of array can be changed… Read More
Predict the output of following Java program. class Test  {     public static void main(String args[])     {        final int arr[] = {1, 2, 3, 4, 5}; … Read More