What is the object oriented way to become rich? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

What is the object oriented way to become rich?

sense of humor

3rd Jul 2017, 4:20 PM
Anjali Dewangan
Anjali Dewangan - avatar
6 Answers
+ 6
Bank.money = 10000000;
3rd Jul 2017, 4:23 PM
AgentSmith
3rd Jul 2017, 4:45 PM
Manual
Manual - avatar
+ 3
class Person { int money; public void Person(String n) { this.money = 0; } } class Main { public static void main(String[] args) { Person cheeze = new Person(); cheeze.money = /* insert amount here */; System.out.println(cheeze.money); } } omg i feel so smart typing this out
3rd Jul 2017, 4:48 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
3rd Jul 2017, 4:39 PM
‎ ‏‏‎Anonymous Guy
0
Class you extends person{ String name; you(String name) { this. Name = name; } public idea think(){ return new idea(); } public boolean checkIfGood(idea I) { if (I.isGood()){ I. Make() ;} else { I.destroy(); this.checkIfGood(this.think()); } } Public static void main (String[] args) { you y = new you(args [0]); y.checkIfGood(y.think()); } }
3rd Jul 2017, 5:43 PM
josh mizzi
josh mizzi - avatar
0
class richPerson: public person { friend class usurper ; private: void withdrawMoney(int); void depositMoney(int); int balance(); callDriver(); ....//all the rich people methods public: ... } class usurper: public person { ... } int main() { richPerson Scrooge; usurper you_as_Spouse; int amount; cout << "How much?" cin >> amount; while (Scrooge.balance()) { you_as_Spouse.withdraw(amount);} return 0; }
3rd Jul 2017, 6:58 PM
Sarv Parteek Singh
Sarv Parteek Singh - avatar