The new keyword should be used to create an array. When an array is created, the
ID: 3693047 • Letter: T
Question
The new keyword should be used to create an array.
When an array is created, the number of elements must be placed in square brackets following the type of element being stored.
The elements of an array have unknown values just after the array has been created.
A for loop is an excellent way to initialize the elements of an array.
Circle is a Java application.
Circle implements the Shape interface.
Circle inherits from the Shape class.
Circle has a nested inner class called Shape.
Typing in a text field.
Clicking on a button.
Viewing the text in a label.
Moving the mouse.
Explanation / Answer
6.6. Which of the following statements about creating arrays and initializing their elements is false?
Answer:The elements of an array have unknown values just after the array has been created.
The new keyword should be used to create an array.
Explanation:
After the array has been created the elements of an array either 0 or null values.It doesn't contain unkonwn values.
int a[]=new int [2];
a[0] a[1]
Similarly Integer[] a[]=new Integer[2]
a[0] a[1]
The array can be created with out using new keyword
Example :int a[]={1,2,3}
The above line creates an array of size 3 with elements 1,2,3
8.What can you say about the following Java class?
Answer:Circle inherits from the Shape class.
Explanation:
Circle class is a child class of Parent class Shape.
It is inheritance concepts.
Circle class has its own properties as well as parent properties.
12.Which of the following does not generate an event?
Answer: Viewing the text in a label.
Explanation:
Viewing the text doesn't create any event,where as when you type in a text field it creates an key event,
Cliking on a button will create action event.
Moving the mouse will create an mouse event.
0 0Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.