Java How To Program (Early Objects) (10th Edition)
Java How To Program (Early Objects) (10th Edition)
10th Edition
ISBN: 9780133807806
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 3, Problem 10.1E
Program Plan Intro

Date Class

Program Plan:

  • Define a class called Date.
  • Declare three private variables of type int to hold month, day and year.
  • Define a default constructor that sets the instance variables to the default values.
  • Define a constructor to initialize the class variables with parameter values.
  • Define set and get methods for each instance variables.
  • Define a method called displayDate() to display the date in the form of month/day/year.
  • Define a class called DateTest.
  • Define the main method.
  • Define a Date object by using parameterized constructor.
  • Call the displayDate() method by using Date object to display the date.
  • Define another Date object by using default constructor.
  • Prompt the user for month, day and year.
  • By using the set methods, set the month, day and year for the object.
  • By using get methods, display the month, day and year values in different formats.
  • Call the displayDate() method by using Date object to display the date.

Blurred answer
Students have asked these similar questions
#pyhton programing topic: Introduction to Method and Designing class Method overloading & Constructor overloading   ------------------ please find the attached image
Please help me with this Java chapter 6 programming challenge. Thank you
Java program

Chapter 3 Solutions

Java How To Program (Early Objects) (10th Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT