Math, asked by adawadi6523, 1 year ago

Define an abstract class named drink which defines the following methods:
a. constructor with two parameters: serialno (drink’s serial number) and description (brief description about the drink). a drink has a sugarcontent which is by default is 0.
b. tostring method that prints the serial number followed by the description and the sugar content of the drink.
c. an increasesugarcontent method that allow us to increase the sugar content by a particular integer amount. for example, if p is a concrete class that extends drink, then we should be able to call increasesugarcontent as follows: p.increasesugarcontent(10).increasesugarcontent(20);
d. an abstract method named getingredients which returns a string with the drink’s ingredients.

Answers

Answered by rkrishnan84oyn0l7
0
30 ingredients are abstract method name
Similar questions