Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Two Java SE classes are declared as shown below: public class Invoice { public static String formatId ( String oldId ) { return oldId +
Two Java SE classes are declared as shown below:
public class Invoice
public static String formatIdString oldId
return oldId Invoice;
public class SalesInvoice extends Invoice
public static String formatIdString oldId
return oldId SalesInvoice;
Which of the following statements are true about attempts to use these classes?
a Invoice invoice new SalesInvoice;
System.out.printlnInvoiceformatId;
Will output SalesInvoice
b SalesInvoice invoicenew SalesInvoice;
System.out.printlnInvoiceformatId;
Will output SalesInvoice
c Invoice invoice new Invoice;
System.out.printlninvoiceformatId;
Will output Invoice
d Invoice invoice new Invoice;
System.out.printlnSalesInvoiceInvoiceformatId;
Will output SalesInvoice
e SalesInvoice invoice new SalesInvoice;
System.out.printlninvoiceformatId;
Will output Invoice
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