Question
What is the primary difference between an abstract class
and an interface in Java regarding abstraction?Solution
o Abstract classes are still classes; they can have constructors, instance variables (fields), and both abstract and concrete methods. They can also contain state. o Interfaces are contracts that define a set of methods that a class must implement. Before Java 8, interfaces could only have abstract methods (and public static final fields). Since Java 8, they can have default and static methods, and since Java 9, private methods. However, interfaces cannot have constructors or instance variables (non-static fields).
A shopkeeper marks an article 40% above its cost price and allows a discount of 20% on the marked price. If the selling price is Rs. 672, find the cost ...
Aman bought two guitars, βPβ and βQβ, with cost prices in the ratio 7:9, and sold them at a loss of 10% and a profit of 30%, respectively. If th...
The marked price of the washing machine is 10% above its cost price. The seller offers two successive discounts of 5% and 10%, respectively. If he incur...
A school bag is sold for Rs.630 after giving two successive discounts of 20% and 30%. If school bag is marked up by Rs.600 above its cost price, then fi...
βAβ and βBβ started a business by investing certain sum in the ratio 13:5, respectively for 6 years. If 10% of the total profit is donated in an...
The average cost price of two items, A and B, is Rs. 600 each. They are sold at profits of 15% and 20% respectively. If the combined selling price of bo...
A product is sold at 15% profit. If its cost price had been 25% lower, and it was sold at a 30% loss, the seller would have made Rs. 280 less. What was ...
- Rahul bought a gadget and increased its price by 60% above the cost price. He sold it after offering a discount of 20% for Rs. 2400. What would be the sell...
A shopkeeper marks his goods 40% above cost price. During a sale, he gives a discount of 20% on the marked price and still makes a profit. What is his p...
Select the options that correctly indicate a 25% profit and a 15% loss