Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Ticket {
- String performance;
- double price;
- int people;
- public Ticket(String performance, double price) {
- this(performance, price, 1); //one person by default
- }
- public Ticket(String performance, double price, int people) {
- this.performance = performance;
- this.price = price;
- this.people = people;
- }
- public String getPerformance() {
- return performance;
- }
- public void setPerformance(String performance) {
- this.performance = performance;
- }
- public double getPrice() {
- return price;
- }
- public void setPrice(double price) {
- this.price = price;
- }
- public int getPeople() {
- return people;
- }
- public void setPeople(int people) {
- this.people = people;
- }
- @Override
- public String toString() {
- return "Ticket [performance=" + performance + ", price=" + price + ", people=" + people + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement