QWhich one of the following is a valid statement?
Question Info
Choose the Best Option
Click any option to instantly check if you're correct.
Explanation
This line of Java code creates a new array of characters called "c" with a length of 5.
The "new" keyword is used to allocate memory for the array, and the "char[]" indicates that it is an array of characters. The number inside the square brackets [] specifies the size of the array, which in this case is 5.
So, the resulting variable "c" is an array that can hold up to 5 characters. Note that the elements of the array are initially set to the default value of the char data type, which is '\0' (the null character).
Want to remember what you got wrong?
Create a free account in seconds to track your score, revisit mistakes and continue Programming Language where you left off.
- Save your progress & streak
- Topic-wise quizzes & scores
- Bookmark tricky questions
- Printable MCQ sets
Nice — 3 questions done!
Don't lose this streak. Sign up free to save your score and pick up exactly where you stopped.
Share This Question
Challenge a friend or share with your study group.