forked from rishav-mishra/Hacktober-2020
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path123java
More file actions
33 lines (31 loc) · 627 Bytes
/
123java
File metadata and controls
33 lines (31 loc) · 627 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// code written in base class
import java.util.*;
class product
{
String name ;
int code;
double amount;
product(String n, int c, double p)
{
name=n;
code=c;
amount=p;
}
void show()
{
System.out.println("NAME OF THE PRODUCT :\t"+name);
System.out.println("PRODUCT CODE :\t"+code);
System.out.println("THE AMOUNT OF THE PRODUCT :\t"+amount);
}
public static void main()
{
Scanner in =new Scanner(System.in);
System.out.println("enter name code and amt");
String n=in.next();
int code =in.nextInt();
int amt=in.nextInt();
product obj=new product(n,code,amt);
obj.show();
}
}
// end of base class