Exam 4: Defining Classes I

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Write a Java method that returns the value of PI,where PI = 3.1415926535.

(Essay)
4.8/5
(40)

Java has a way of officially hiding details of a class definition.To hide details,you mark them as _________.

(Multiple Choice)
4.9/5
(32)

It is considered good programming practice to validate a value passed to a mutator method before setting the instance variable.

(True/False)
4.9/5
(38)

The modifier private means that an instance variable can be accessed by name outside of the class definition.

(True/False)
4.8/5
(35)

A variable whose meaning is confined to a method definition is called an/a

(Multiple Choice)
4.9/5
(36)

A more eloquent approach in implementing mutator methods is to return a ________ value.

(Multiple Choice)
4.8/5
(41)

A variable whose meaning is confined to an object of a class is called:

(Multiple Choice)
4.9/5
(31)

A method that performs some action other than returning a value is called a __________ method.

(Multiple Choice)
4.8/5
(41)

Java supports operator overloading.

(True/False)
4.9/5
(40)

Method overloading is when two or more methods of the same class have the same name but differ in number or types of parameters.

(True/False)
4.7/5
(44)

When the parameters in a method have the same as instance variables you can differentiate them by using the _____ parameter.

(Multiple Choice)
4.8/5
(37)

Inside a Java method definition,you can use the keyword this as a name for the calling object.

(True/False)
4.8/5
(39)

The name of a method and the list of ________ types in the heading of the method definition is called the method signature.

(Multiple Choice)
4.8/5
(46)

Boolean expressions may be used to control if-else or while statements.

(True/False)
4.8/5
(46)

The parameter this refers to

(Multiple Choice)
4.9/5
(32)

Write a method called Greeting that displays a personalized greeting given a first name.

(Essay)
4.8/5
(40)

Write a method called power the computes x< sup >n< /sup > where x and n and positive integers.The method has two integer parameters and returns a value of type long.

(Essay)
4.8/5
(37)

Write a driver program to test your Student class created in question #14.

(Essay)
4.8/5
(33)

In a method invocation,there must be exactly the same number of arguments in parentheses as there are formal parameters in the method definition heading.

(True/False)
4.8/5
(36)

Write a Java method that prints the phrase "Five purple people eaters were seen munching Martians".

(Essay)
4.9/5
(32)
Showing 21 - 40 of 45
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)