Purchase Solution

Java Creating a Class Called Date

Not what you're looking for?

Ask Custom Question

Create a class called SimpleDate that includes three instance variables - a month, a day and a year (all type int). Provide a constructor that initializes the three instance variables and validates that those values are correct (follow calendar rules) and throws an exception for incorrect values. Provide a set and get method for each instance variable. Provide a toString method override that displays the month, day and year separated by forward slashes (/).
Write a test application named SimpleDateTest that demonstrates class SimpleDate's capabilities

Purchase this Solution

Solution Summary

This solution helps create a class called SimpleDate, which includes three instance variables (month, day and year). It also provides a constructor that initializes the three initializes three instance variables and validates that those values are correct. It also provides a set and get method for each instance variable and a toString method to override the display. In addition, a test application named SimpleDateTest demonstrating SimpleDate's capabilities is given.

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Javscript Basics

Quiz on basics of javascript programming language.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.