5 years ago in Introduction To Java

Which one of the following will declare an array and initialize it with five numbers?

[A] Array a = new Array(5);
[B] int [] a = {23,22,21,20,19};
[C] int a [] = new int[5];
[D] int [5] array;
Loading...
Next Question

Overall Stats

Attempted 298
Correct 106
Incorrect 78
Viewed 114

Answers

Guest
Guest
Shamsa hafeez
Shamsa hafeez - 1 week ago

Shamsa hafeez from Lahore, Pakistan is saying int a [] = new int[5]; is correct answer

akshay kharat
akshay kharat - 2 weeks ago

akshay kharat from Pune, India is saying int [] a = {23,22,21,20,19}; is correct answer

Tsega Asresa Mengistu
Tsega Asresa Mengistu - 2 weeks ago

Tsega Asresa Mengistu from Dessie, Ethiopia is saying Array a = new Array(5); is correct answer

Utkarsh Sharma
Utkarsh Sharma - 1 month ago

Utkarsh Sharma from Dehradun, India is saying int [] a = {23,22,21,20,19}; is correct answer

Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying int a [] = new int[5]; is correct answer

Related Questions

static assign memory st

  • [A] load time
  • [B] compile time

valid keyword in java

  • [A] String
  • [B] Interface

Which is a reserved word in the Java programming language?

  • [A] method
  • [B] native
  • [C] subclasse
  • [D] array