Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer the following question? Consider the class diagram provided in Figure 1. Name one method that is over-ridden in the EconomyTicket class. [1 mark] __________________________________________________________________
Answer the following question?
- Consider the class diagram provided in Figure 1. Name one method that is over-ridden in the EconomyTicket class. [1 mark]
__________________________________________________________________
- What does it mean to over-ride a method in java? [2 marks]
-
This question relates to the UML diagram provided in Figure 1.
- Given the following 2 lines of code:
- 1 TrainService ts = new TrainService(ByronBay, Central, 10:00);
- concessionTkType = new TicketType(TicketType.CONCESSION);
- State whether the following lines of code are valid or not: [3 x 1 marks]
- Ticket tk = new Ticket(ts, concessionTkType);
- ANS ____________________________________________________
- FIrstClassTicket fct = new FirstClassTicket(ts, concessionTkType);
- ANS ____________________________________________________
-
- FirstClassTicket fctik = new Ticket(tk, concessionTkType);
-
ANS ____________________________________________________
- For each of the above lines of code give a reason for why they are/are not valid [3 x 1 marks]
- ANS
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started