Question: Which of the following are valid declarations? Which instantiate an array object? Explain your answers. int primes = {2, 3, 4, 5, 7, 11}; float
Which of the following are valid declarations? Which instantiate an array object? Explain your answers.
int primes = {2, 3, 4, 5, 7, 11};
float elapsedTimes[] = {11.47, 12.04, 11.72, 13.88};
int[] scores = int[30];
int[] primes = new {2,3,5,7,11};
int[] scores = new int[30];
char grades[] = {'a', 'b', 'c', 'd', 'f'};
char[] grades = new char[];
Step by Step Solution
3.53 Rating (163 Votes )
There are 3 Steps involved in it
int primes 2 3 4 5 7 11 Invalid an int cannot be declared and initialized using an intializer list T... View full answer
Get step-by-step solutions from verified subject matter experts
