Question
The following Java code attempts to define an abstract
class and use it. Identify the best way to correct the error to allow instantiation of a concrete class. abstract class Vehicle { Â Â abstract void start(); Â Â void stop() { Â Â Â Â System.out.println("Vehicle stopped."); Â Â } } class Car extends Vehicle { Â Â // Missing implementation } public class Main { Â Â public static void main(String[] args) { Â Â Â Â Car myCar = new Car(); Â Â Â Â myCar.start(); Â Â } }Solution
o In Java, if a class (like Vehicle) has an abstract method (start()), then that class itself must be declared abstract. o Any concrete class (a class that can be instantiated, like Car is intended to be) that extends an abstract class must provide an implementation for all inherited abstract methods. o Since Car does not implement start(), it is implicitly abstract and cannot be instantiated. To fix this, Car needs to provide a concrete implementation for the start() method.
XYZ Ltd. reported a net profit of ₹120 lakhs for the year ended 31st March 2025. The depreciation for the year was ₹20 lakhs, and amortization of go...
A company enters into a contract to construct a specialized asset over 4 years. At the end of Year 2, total costs incurred are ₹60 lakh, estimated tot...
What banking transaction involves the exchange of one currency for another at the prevailing exchange rate?
Sales = Rs. 50,000/-, G.P. on sales is 10%, Purchases 40,000/-, Opening Stock
= 70,000/-, Find the closing stock.
According to RBI's KYC Directions, if KYC/AML standards differ between RBI and a host country regulator for foreign branches of Indian banks, which stan...
Under SA 240, the auditor’s responsibility relates to identifying and assessing risks of material misstatement due to fraud. If a whistleblower inform...
Which of the following is NOT a best practice under Green Computing?
Who is called father of modern accountancy who also described the duties and responsibilities of auditor?
Value of supply under section 15(1) is:
How much amount of exemption is allowed for gratuity if received at the time of retirement?