Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10 quick questions for Java! Thanks to whomever helps! I appriciate it! 1. Identify the false statement. a. During one program execution, a method might

10 quick questions for Java! Thanks to whomever helps! I appriciate it!

1. Identify the false statement.

a. During one program execution, a method might be called any number of times.
b. A method is usually written within another method.
c. Any class can contain an unlimited number of methods.

2. Identify the false statement.

a. Not all methods return a value, but every method requires a return type.
b. A method header is also called an implementation.
c. When a method is declared with public access, methods in other classes can call it.

3. Identify the false statement.

a. A method header always contains a return type, an identifier, and a parameter list within parentheses.
b. A class can contain any number of methods, and each method can be called any number of times.
c. Arguments are used in method calls; they are passed to parameters in method headers.

4. Identify the false statement.

a. You cannot place a method within another method, but you can call a method from within another method.
b. The return type for a method can be any type used in Java, including int, double, and void.
c. A method's declared return type must match the type of the value used in the parameter list.

5. Identify the false statement.

a. Objects gain their attributes and methods from their classes.
b. An application or class that instantiates objects of another prewritten class is a class client.
c. A class is an instantiation of many objects.

6. Identify the false statement.

a. When you instantiate objects, each has its own copy of each static data field in the class.
b. Most fields in a class are private, and most methods are public.
c. A class header contains an optional access specifier, the keyword class, and an Identifier.

7. Identify the false statement.

a. Static methods are instance methods.
b. The keyword static is used with classwide methods, but not for methods that "belong" to objects.
c. When you create a class from which objects will be instantiated, most methods are nonstatic because they are associated with individual objects.

8. Identify the false statement.

a. An object name is a reference; it holds a memory address.
b. When you don't write a constructor for a class, Java creates one for you; the name of the constructor is always the same as the name of its class.
c. When you declare an object, you give it a name and set aside enough memory for the object to be stored.

9. Identify the false statement.

a. The automatically supplied default constructor sets all numeric fields to 0, character fields to Unicode '\u0000', Boolean fields to false, and fields that are object references to null.
b. When you write a constructor, it must have the same name as the class it constructs, and it cannot have a return type.
c. In Java, you cannot write a default constructor; it must be supplied for you automatically.

10. Identify the false statement.

a. The address of an instantiated object can be assigned to a declared reference of the same type.
b. Unlike a primitive variable, an instantiated object cannot be passed into or returned from a method.
c. When you declare a primitive variable or instantiate an object from a class, you provide both a type and an identifier.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions