Knowee
Questions
Features
Study Tools

Determine the outputclass array_output {                 public static void main(String args[])                 {                                 char array_variable [] = new char[10];                                 for (int i = 0; i < 10; ++i)                                 {                                                 array_variable[i] = 'i';                                                  System.out.print(array_variable[i] + "");                                }                } } Select one:a.i j k l m n o p q rb.0 1 2 3 4 5 6 7 8 9 10c.1 2 3 4 5 6 7 8 9 10d.i i i i i i i i i i

Question

Determine the outputclass array_output {                 public static void main(String args[])                 {                                 char array_variable [] = new char[10];                                 for (int i = 0; i < 10; ++i)                                 {                                                 array_variable[i] = 'i';                                                  System.out.print(array_variable[i] + "");                                }                } } Select one:a.i j k l m n o p q rb.0 1 2 3 4 5 6 7 8 9 10c.1 2 3 4 5 6 7 8 9 10d.i i i i i i i i i i

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The correct answer is d. i i i i i i i i i i. This is because the code is setting each element of the array_variable to 'i' and then printing it out. So, it will print 'i' 10 times.

Similar Questions

What is the output of the following code?public 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++; } }}Options: Pick one correct answer from below0 2 4 6 81 3 5 7 90 1 2 3 4 5 6 7 8 91 2 3 4 5 6 7 8 9 10

What will be the output of the following Java program? class array_output { public static void main(String args[]) { char array_variable [] = new char[10]; for (int i = 0; i < 10; ++i) { array_variable[i] = 'C'; System.out.print(array_variable[i] + "" ); i++; } } }OptionsCCCCCCCCCCCCCCCC D E F GNone of the mentioned

elect the correct answerWhat 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 < 3; ++i)     {      array_variable[i] = 'R';      System.out.print(array_variable[i] + "");    }  } }OptionsPQR0 1 2 3 4 51 2 3 4 5 6 7 8 9 10RRR

Determine the output:public class Test{        public static void main(String[] args)                {                int[] x = {1, 2, 3, 4};                int[] y = x;                x = new int[2];                                for(int i = 0; i < x.length; i++)                        System.out.print(y[i] + " ");        }}Select one:a.1 2b.0 0c.0 0 0 0d.1 2 3 4

Determine the output: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);                 } }Select one:a.1b.6c.3d.0

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.