restrictedpowder

Ads

 
 

Share on Google+Share on Google+

arvind
restrictedpowder
0 Answer(s)      6 years and 8 months ago
Posted in : Java Beginners

import java.io.*; import java.util.*; class Powder { private int weight; private int price; Powder() { } Powder(int weight,int price) { this.weight=weight; this.price=price; } public void setweight(int weight) { this.weight=weight; } public void setprice(int price) { this.price=price; } public int getweight() { return weight; } public int getprice() { return price; } public void getDetailsOfPowder() {if (weight==50) { setprice(10); } else { setweight(80); setprice(15); }

}
}

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:

Ads

 
Advertisement null

Ads