Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 ) What does the following statement do ? double [ ] array 1 = new double [ 1 0 ] ; A ) Declares
What does the following statement do
double array new double;
A Declares array to be a reference to an array of double values
B Creates an instance of an array of double values
C Will allow valid subscripts in the range of
D All of the above
Given that String str has been initialized, to get a copy of str with all characters converted to upper case, use the following statement:
A struppercase;
B strupperCase;
C strtoUpperCase;
D strtoUpperCase;
What will be returned from the following method?
public static float getValueint x
A A float value
B An array of float values
C An integer
D An array of integers
What would be the results after the following code was executed?
int x ;
int y ;
x y;
y x;
A x and y
B x and y
C x and y
D This is a compilation error.
What will be the result of executing the following code?
int x ;
A An array of values ranging from through and referenced by the variable x will be created.
B A compilation error will occur.
C The program will crash when it is executed.
D The value of x will be x will be x will be x will be x will be and x will be
What would be the results of the following code?
int x
;
int a ;
ifx x
a ;
else
a ;
A a
B a
C a
D This is a compilation error; you cannot compare array elements.
If numbers is a twodimensional array, which of the following would give the length of row r
A numbers.length
B numbers.lengthr
C numbersrlengthr
D numbersrlength
Each array in Java has a public field named that contains the number of elements in the array.
A size
B capacity
C length
D limit
Part B: State TRUE or FALSE:
An array can hold multiple values of several different data types simultaneously.
An ArrayList object automatically expands in size to accommodate the items stored in it
Once an array is created, its size cannot be changed.
Java does not limit the number of dimensions that an array may have.
Objects in an array are accessed with subscripts, just like any other data type in an array.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started