Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 878 Bytes

File metadata and controls

13 lines (8 loc) · 878 Bytes

Java Class Structures

This is a simple package private class structure in Java. For those who are starting Java, this is a very important step. Understanding your access modifiers in Java are fundamental to implement package privates classes or methods.

Invoice Class

Creating a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. The method getInvoiceAmount calculates the invoice amount and returns the amount as a double value. InvoiceTest is a test application that demonstrates class Invoice’s capabilities.

Date Class

Creating a simple class called Date that includes three instance variables—a month, a day and a year. It provides a method displayDate that displays the month, day and year separated by forward slashes. DateTest is a test application that demonstrates class Date’s capabilities.