Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is a static method? Flag this Question Question 21 ptsWhat kind of variable

ID: 3570574 • Letter: W

Question

What is a static method?

Flag this Question

Question 21 ptsWhat kind of variable belongs to the class as a whole and not to just one object?

What kind of variable belongs to the class as a whole and not to just one object?

Flag this Question

Question 31 ptsAll of the methods in the Math class are of what type?

All of the methods in the Math class are of what type?

Flag this Question

Question 41 ptsWhat is the process of going from the value of a primitive type to an object of its wrapper class?

What is the process of going from the value of a primitive type to an object of its wrapper class?

Flag this Question

Question 51 ptsWhich static method can be used to generate pseudo-random numbers?

Which static method can be used to generate pseudo-random numbers?

Flag this Question

Question 61 ptsWhat is an array?

What is an array?

Flag this Question

Question 71 pts<p>What code below creates a new array, having 5 elements of type double</p>

What code below creates a new array, having 5 elements of type double

Flag this Question

Question 81 ptsWhich array instance variable returns the number of elements in the array?

Which array instance variable returns the number of elements in the array?

Flag this Question

Question 91 ptsWhat code below declares an integer array having three elements and initializes all elements to 0?

What code below declares an integer array having three elements and initializes all elements to 0?

Flag this Question

Question 101 ptsWhat for-each example below initializes all values of the int array score to 100?

What for-each example below initializes all values of the int array score to 100?

Flag this Question

Question 111 ptsWhat method below will sort an array of doubles called golfScores?

What method below will sort an array of doubles called golfScores?

Flag this Question

Question 121 ptsWhat is the process by which a new class is created from another class?

What is the process by which a new class is created from another class?

Flag this Question

Question 131 ptsWhen a new class is created from another class, what is the new class called?

When a new class is created from another class, what is the new class called?

Flag this Question

Question 141 ptsWhen a method in a derived class has a different set of arguments from the base class, what has been done to that method?

When a method in a derived class has a different set of arguments from the base class, what has been done to that method?

Flag this Question

Question 151 ptsWhen a method in a derived class has the exact same number and types of parameters as in the base class, what has been done to that method?

When a method in a derived class has the exact same number and types of parameters as in the base class, what has been done to that method?

Flag this Question

Question 161 ptsWhat modifier can be added to a method to prevent derived classes from being redefined in base classes?

What modifier can be added to a method to prevent derived classes from being redefined in base classes?

Flag this Question

Question 171 ptsWhat keyword is used to call the base class constructor?

What keyword is used to call the base class constructor?

Flag this Question

Question 181 pts<p>Methods form the object's _______ with the outside world.</p>

Methods form the object's _______ with the outside world.

Flag this Question

Question 191 pts<p>Interfaces form a ______ between the class and the outside world, enforced by the compiler.</p>

Interfaces form a ______ between the class and the outside world, enforced by the compiler.

Flag this Question

Question 201 ptsWhat mechanism in object-oriented programming constitutes the ability to associate many meanings to one name?

What mechanism in object-oriented programming constitutes the ability to associate many meanings to one name?

Flag this Question

Question 211 ptsWhen the process of associating method definition with method invocation happens at run time, this is called...?

When the process of associating method definition with method invocation happens at run time, this is called...?

Flag this Question

Question 221 ptsJava uses static binding for what kinds of methods?

Java uses static binding for what kinds of methods?

Flag this Question

Question 231 ptsAs a general rule, downcasting has to be done very carefully and in many cases it doesn't make sense, or is illegal.

As a general rule, downcasting has to be done very carefully and in many cases it doesn't make sense, or is illegal.

Flag this Question

Question 241 ptsWhat mechanism in Java signals when something unusual is happening?

What mechanism in Java signals when something unusual is happening?

Flag this Question

Question 251 ptsEvery exception has a method that returns a String identifying the reason for the exception. What is that method?

Every exception has a method that returns a String identifying the reason for the exception. What is that method?

Flag this Question

Question 261 pts<p>A try block can catch more than one different type of exception.</p>

A try block can catch more than one different type of exception.

Flag this Question

Question 271 ptsWhat object enables the flow of data between a program and a file?

What object enables the flow of data between a program and a file?

Flag this Question

Question 281 ptsFiles that are meant to be read by humans are of what type?

Files that are meant to be read by humans are of what type?

Flag this Question

Question 291 pts<p>What Scanner method can be used to detect the end of a file?</p>

What Scanner method can be used to detect the end of a file?

Flag this Question

Question 301 ptsWhat type of method includes a call to itself?

What type of method includes a call to itself?

Flag this Question

Question 311 pts<p>What stream class is used to write data to a text file?</p>

What stream class is used to write data to a text file?

Flag this Question

Question 321 pts<p>Whenever you are finished writing to a text file, why does the close() method need to be called?</p>

Whenever you are finished writing to a text file, why does the close() method need to be called?

Flag this Question

Question 331 ptsWhat is true about the use of ArrayLists instead of an array?

What is true about the use of ArrayLists instead of an array?

Flag this Question

Question 341 ptsWhat is another way a recursive task can always be done?

What is another way a recursive task can always be done?

Flag this Question

Question 351 ptsWhat method is used to determine how many values are in an ArrayList?

What method is used to determine how many values are in an ArrayList?

Flag this Question

Question 361 ptsAn initial capacity must always be specified when creating a new ArrayList.

An initial capacity must always be specified when creating a new ArrayList.

Flag this Question

Question 371 ptsWhich class is nearly interchangable with the ArrayList class?

Which class is nearly interchangable with the ArrayList class?

Flag this Question

Question 381 ptsWhat is the process of going from an object of a wrapper class to the corresponding value of a primitive type?

What is the process of going from an object of a wrapper class to the corresponding value of a primitive type?

Flag this Question

Question 391 ptsWhich expression below represents the first element of the array named testScores?

Which expression below represents the first element of the array named testScores?

Flag this Question

Question 401 ptsWhat kind of case is required in a successful recursive method definition to avoid infinite recursion?

What kind of case is required in a successful recursive method definition to avoid infinite recursion?

Only the main method is static

Explanation / Answer

1)

Only the main method is static

2)

A static variable belongs to the whole class but not just one object. So, Static variable is the correct answer.

3)

All of the methods in the Math class are of Static type.

So, Static is the correct answer.

4)

The process of going from a value of a primitive type to an object of its wrapper class is called as Boxing.

So, the correct answer is Boxing.

5)

The static method that can be used to generate pseudo-random numbers is Math.random( ).

So, the correct answer is Math.random( )

6)

An array is a data structure used to process a collection of data that is all of the same type.

7)

double[ ] score = new double[5];

8)

length

9)

int[ ] age = {0, 0, 0}

10)

for (int x : score) x = 100;

11)

Arrays.sort(golfScores);

12)

Inheritance

13)

derived/child class

14)

redefining a method

15)

overriding a method

If you want answers for the remaining questions, please post another one.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote