package myq2; class Sale { int sellerID, milksale, buttersale; Sale(int sid, int ms, int bs) { sellerID = sid; milksale- ms; buttersale - bs; } elling dairy ifferent days using OOP ers, based on YQ2...


package myq2;<br>class Sale {<br>int sellerID, milksale, buttersale;<br>Sale(int sid, int ms, int bs) {<br>sellerID = sid;<br>milksale- ms;<br>buttersale - bs;<br>}<br>elling dairy<br>ifferent days<br>using OOP<br>ers, based on<br>YQ2<br>int totalsaving(){<br>return milksale + buttersale;<br>}<br>}<br>ale<br>public class Myq2 {<br>public static void main(String[] args) {<br>Sale s = new Sale(111, 10, 20);<br>System.out.println(

Extracted text: package myq2; class Sale { int sellerID, milksale, buttersale; Sale(int sid, int ms, int bs) { sellerID = sid; milksale- ms; buttersale - bs; } elling dairy ifferent days using OOP ers, based on YQ2 int totalsaving(){ return milksale + buttersale; } } ale public class Myq2 { public static void main(String[] args) { Sale s = new Sale(111, 10, 20); System.out.println("Seller ID" + s.sellerID ); System.out.println("Total Saving "+s.totalsaving()); } } 4) Use the parameterized constructor to initialize the member variables of the class. 5) Display the following details of seller using object of Sale class. seller ID, totalsaving Solution to program

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here