-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignmentTest1.java
More file actions
61 lines (47 loc) · 1.56 KB
/
Copy pathAssignmentTest1.java
File metadata and controls
61 lines (47 loc) · 1.56 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.intellect.karthik;
class Product {
void print(int id) {
System.out.println("Product " + id);
}
void print(String pCode) {
System.out.println("Product Code" + pCode);
}
void print(double pCost) {
System.out.println("Product Cost" + pCost);
}
void print(float pDisc, double pGst) {
System.out.println("Product discount" + pDisc + ",Product GST" + pGst);
}
void print(String pVen, String pDisc) {
System.out.println("Product Vendor" + pVen + ",Product discount" + pDisc);
}
void print(int id, String pComName) {
System.out.println("Product id" + " and Company" + pComName);
}
void print(Object prodDetails) {
System.out.println(prodDetails);
}
void print(int id, String pCode, double pCost, float pDisc, float pGst, String pVen, String pComName) {
System.out.println(
"Product" + id + "," + pCode + "," + pCost + "," + pDisc + "," + pGst + "," + pVen + "," + pComName);
}
@Override
public String toString() {
return "Product [getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString()
+ "]";
}
}
public class AssignmentTest1 {
public static void main(String[] args) {
AssignmentTest2 mot = new AssignmentTest2();
Product prod = new Product();
prod.print(101);
prod.print("developer");
prod.print(2345000.98);
prod.print(2, 1.5);
prod.print(101, "Oracle Software sol");
prod.print("oracle", "SQL dev Tool");
prod.print(101, "developer", 2345000.98, 2, 3, "oracle", "Oracle Software sol");
prod.print(prod);
}
}