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.
- Rohit contributed 84 runs in a game, which accounted for 60% of the team’s total score. If the team received 15 runs as extras, then how many runs were s...
- The ratio of apples to oranges in a basket is 3:2. If 12 apples are removed and 18 oranges are added, then the number of apples and oranges becomes equal. ...
A chemist combines three solutions with active ingredient concentrations of 10%, 20%, and 30% in the ratio 2:3:5. If the total volume of the mixture is ...
Rs 2106 was divided among Anil, Bhanu and Charan in the ratio of 13:10:16 respectively. Find the amount received by Anil and Bhanu together.
A box contains red, blue, and green balls in the ratio of 3:4:5. If there are 60 balls in total, how many blue balls are there?
- If u : v = 6 : 11, determine the ratio (u + 2v) : (2u + v)

In a T20 match, the total runs scored by five batsmen is 400. The ratio of runs scored by Williamson to Taylor is 11:9. If 2/5th of the total runs are s...
A is thrice as efficient as B and C is twice as efficient as B. What is the ratio of number of days taken by A, B and C when they work individually?
If ‘X’, ‘Y’ and ‘Z’ are in proportion in the same order and ‘X’ = 36 and ‘Y’ = 54, then find the value of ‘Z’.
...