Examine the clocktype class definition

Assignment Help JAVA Programming
Reference no: EM131100861

Question 1. The components of a class are called _____ and _____.

elements; objects
attributes; methods
objects; instantiations
properties; descriptions

Question 2. Which of the following would be the most appropriate choice for a method in a Cup class?

drink()
hot()
break()
color()

Question 3. Which of the following statements is/are true?

A. Objects communicate through message passing.
B. An object must be defined before you can create a class.
C. The state of an object should not be hidden.
D. Implementation details should be visible through the interface of a class.

A and C
All are true
None are true

Question 4. Which of the following would be the most appropriate choice for a data member in a Screen class?

dimensions
turnOff
refresh
activate Screen Saver

Question 5. The property of _____ describes the packaging of state and behavior together in an object.

data hiding
abstraction
encapsulation
All of the above
None of the above

Question 6. Most professional coding standards use _____ for class names.

underscores along with all upper case words
Method Class case
no specific naming convention
Pascal case

Question 7. Examine the ClockType class definition. How many attributes does it contain?

class ClockType
{
public void setTime(int hour, int min, int sec);
public int getTime();
public void printTime();
private int hr;
public int min;
public int sec;
}

2
3
9
6

An average of 5 because (7+3)/2 = 5

Question 8. Assume we have two classes and have instantiated an object from each class. How many copies of each class's attributes and methods exist in the instantiated objects?

Two copies, one copy of the first class and one of the second
Zero, the objects do not have attributes and methods
Only one copy and both objects share it
None of the above

Question 9. Both _____ and _____ allow for code reuse and the building of more complex systems.

inheritance; composition
UML diagrams; serialization
messaging; object behaviors
None of the above

Question 10. Which of the following is a valid statement for a method definition in Java?

public int computeAverage {
return 1;
}
public int computeAverage (
return 1;
)
public int computeAverage () {
return 1;
};
public int computeAverage () {
return 1;
}

Reference no: EM131100861

Questions Cloud

What are some of benefits of creating a personal action plan : A key part to everyone's personal action plan should be the portfolio. A portfolio is composed of many elements. What part of the portfolio do you think is the most important content element?
Following sentences contains an italicized word : 1. Which of the following sentences contains an italicized word that's used as a predicate adjective? A. Jerry looks at the map.
Profit margin on item sold : Berry Farm paid an upfront fee of $160 to present its products at the market for one week, and the market earns a 25% profit margin on each item sold, but Berry Farm is responsible for any items that remain unsold at the end of the week.
Find current stock price is $30, exercise price is $35 : Use the Black-Scholes model to find the price for a call option with the following inputs: (1) current stock price is $30, (2) exercise price is $35, (3) time to expiration is 4 months, (4) annualized risk-free rate is 5%, and (5) variance of stock r..
Examine the clocktype class definition : Examine the ClockType class definition. How many attributes does it contain? Assume we have two classes and have instantiated an object from each class. How many copies of each class's attributes and methods exist in the instantiated objects?
Determining the improve logisitics : Write a 2 page paper with 2-3 references discussing supply chain and distribution channels. You may include one or two small graphics to further explain your position.
Understanding of classical and operant conditioning : Demonstrate your understanding of classical and operant conditioning through application and comparison. There are four steps to this essay.
Does the voltage gain increase or decrease : The trans-conductance falls but the output resistance rises. Does the voltage gain increase or decrease?
Computing the market potential indicator : Market Potential Indicator (MPI) is an index used to compare emerging markets along various dimensions. This index was developed as a result of an extensive study by MSU CIBER (Michigan State University Center for International Business Education ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Calculate rental fee for different types of borrowable media

Assume that there is an abstract class called Vehicle, which has two concrete subclasses, Car and Truck. There is also an interface Loadable, which only Truck implements - calculate a rental fee for different types of borrowable media (e.g. books,..

  Application that stores at least four different course names

The application as written does not display certain class names included in the instructions as written.

  Sudoku game - java program

You will be designing a simple Sudoku Game.  The rules of Sudoku can be found on web. The rules are explained:

  The java code conventions

The database must be able to retrieve client information and display it on the screen for a specific telephone number match. The program must be well commented and documented using javadoc. The program must conform to the Java Code Conventions

  Create a book class for the library application project

Create a Book class for the Library application project. In addition to properties of author and isbn, with setters/getters, the Book should override Object's base method "boolean equals(Object)" and have a "boolean validate()" method.

  Overhead required for reading a word

A computer whose processes have 1024 pages in their address spaces keeps its page tables in memory. The overhead required for reading a word from the page table is 5 nsec.

  Development of a simple program involving multiple classes

Development of a Simple Program Involving Multiple Classes and development of a basic Class, development of the Country and World classes

  Describe the airlines information management system project.

i require assistance in finalizing the requirements model for the Airlines Information Management System (AIMS) project. The requirements model need to include use UML case diagrams for the entire AIM system.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Methods

Assignment describe the basic working of methods. How to write a method in java and how to call a method.

  Hasanodddigit that returns whether any digit

d named hasAnOddDigit that returns whether any digit of a positive integer is odd. Your method should return true if the number has at least one odd digit and false if none of its digits are odd. 0, 2, 4, 6, and 8 are even digits, and 1, 3, 5, 7, 9 a..

  Create a class that uses the genetricstack class

Create a new class named GenericStack that specifies a type variable that gives for generics - Use the peek method to return the first item and show that item, and use the size method to return the number of items again and show that value.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd