1 Introduction To Computers And Java 2 Java Fundamentals 3 Decision Structures 4 Loops And Files 5 Methods 6 A First Look At Classes 7 Arrays And The Arraylist Class 8 A Second Look At Classes And Objects 9 Text Processing And More About Wrapper Classes 10 Inheritance 11 Exceptions And Advanced File I/o 12 Javafx: Gui Programming And Basic Controls 13 Javafx: Advanced Controls 14 Javafx: Graphics, Effects, And Media 15 Recursion 16 Databases expand_more
6.1 Objects And Classes 6.2 Writing A Simple Class, Step By Step 6.3 Instance Fields And Methods 6.4 Constructors 6.5 Passing Objects As Arguments 6.6 Overloading Methods And Constructors 6.7 Scope Of Instance Fields 6.8 Packages And Import Statements 6.9 Focus On Object-oriented Design: Finding The Classes And Their Responsibilities 6.10 Common Errors To Avoid Chapter Questions expand_more
Problem 1MC: This is a collection of programming statements that specify the fields and methods that a particular... Problem 2MC: A class is analogous to a(n) _______. a. house b. blueprint c. drafting table d. architect Problem 3MC: An object is a(n) ________. a. blueprint b. primitive data type c. variable d. instance of a class Problem 4MC: This is a class member that holds data. a. method b. instance c. field d. constructor Problem 5MC: This key word causes an object to be created in memory. a. create b. new c. object d. construct Problem 6MC: This is a method that gets a value from a classs field, but does not change it. a. accessor b.... Problem 7MC: This is a method that stores a value in a field or in some other way changes the value of a field.... Problem 8MC: When the value of an item is dependent on other data, and that item is not updated when the other... Problem 9MC: This is a method that is automatically called when an instance of a class is created. a. accessor b.... Problem 10MC: When a local variable has the same name as a field, the local variables name does this to the fields... Problem 11MC: This is automatically provided for a class if you do not write one yourself. a. accessor method b.... Problem 12MC Problem 13MC Problem 14MC: A classs responsibilities are __________. a. the objects created from the class b. things the class... Problem 15TF: True or False: The new operator creates an instance of a class. Problem 16TF: True or False: Each instance of a class has its own set of instance fields. Problem 17TF: True or False: When you write a constructor for a class, it still has the default constructor that... Problem 18TF: True or False: A class may not have more than one constructor. Problem 19TF: True or False: To find the classes needed for an object-oriented application, you identify all of... Problem 1FTE: Find the error in the following class: public class MyClass { private int x; private double y;... Problem 2FTE Problem 3FTE: The following statement attempts to create a Rectangle object. Find the error. Rectangle box = new... Problem 4FTE: Find the error in the following class: public class TwoValues { private int x, y; public TwoValues()... Problem 5FTE: Find the error in the following class: public class FindTheError { public int square(int number) {... Problem 1AW: Design a class named Pet, which should have the following fields: name. The name field holds the... Problem 2AW: Look at the following partial class definition, and then respond to the questions that follow it:... Problem 3AW: Consider the following class declaration: public class Square { private double sideLength; public... Problem 4AW: Look at the following description of a problem domain: Problem 5AW: The bank offers the following types of accounts to its customers: savings accounts, checking... Problem 6AW: Assume that you are writing an application that will calculate the amount of interest earned for a... Problem 1SA: What is the difference between a class and an instance of a class? Problem 2SA: A contractor uses a blueprint to build a set of identical houses. Are classes analogous to the... Problem 3SA: What is an accessor method? What is a mutator method? Problem 4SA: is it a good idea to make fields private? Why or why not? Problem 5SA: If a class has a private field, what has access to the field? Problem 6SA Problem 7SA: Assume a program named MailList.java is stored in the DataBase folder on your hard drive. The... Problem 8SA: Why are constructors useful for performing start-up operations? Problem 9SA: Under what circumstances does Java automatically provide a default constructor for a class? Problem 10SA: What do you call a constructor that accepts no arguments? Problem 11SA Problem 12SA: How does method overloading improve the usefulness of a class? Problem 1PC: Employee Class Write a class named Employee that has the following fields: name. The name field... Problem 2PC: Car Class Write a class named Car that has the following fields: yearModel. The yearModel field is... Problem 3PC: Personal Information Class Design a class that holds the following personal data: name, address,... Problem 4PC: Retail Item Class Write a class named RetailItem that holds data about an item in a retail store.... Problem 5PC: Payroll Class Design a Payroll class that has fields for an employees name, ID number, hourly pay... Problem 6PC: TestScores Class Design a TestScores class that has fields to hold three test scores. The class... Problem 7PC: Circle Class Write a Circle class that has the following fields: radius: a double PI: a final double... Problem 8PC: Temperature Class Write a Temperature class that will hold a temperature in Fahrenheit, and provide... Problem 9PC: Days in a Month Write a class named MonthDays, The classs constructor should accept two arguments:... Problem 10PC: A Game of Twenty-One For this assignment, you will write a program that lets the user play against... Problem 11PC: Freezing and Boiling Points The following table lists the freezing and boiling points of several... Problem 12PC: SavingsAccount Class Design a SavingsAccount class that stores a savings accounts annual interest... Problem 13PC: Deposit and Withdrawal Files Use Notepad or another text editor to create a text file named... Problem 14PC: Patient Charges Write a class named Patient that has fields for the following data: First name,... Problem 15PC: Dice Game Write a program that uses the Die class that was presented in this chapter to play a... Problem 16PC: Roulette Wheel Colors On a roulette wheel, the pockets are numbered from 0 to 36. The colors of the... Problem 17PC: Coin Toss Simulator Write a class named Coin. The Coin class should have the following field: A... Problem 18PC: Tossing Coins for a Dollar For this assignment you will create a game program using the Coin class... Problem 19PC: Fishing Game Simulation For this assignment, you will write a program that simulates a fishing game,... format_list_bulleted