随笔分类 -  ood

Ood : static
摘要:Ood : static https://www.geeksforgeeks.org/static-keyword-java/ When to use static variables and methods? Use the static variable for the property tha 阅读全文

posted @ 2018-11-09 11:49 猪猪🐷

OOD 2 : design parking lot
摘要:public enum VehicleSize{ Compact(1); Large(2); // ? why use number private final int size; VehicleSize(int size){ this.size = size; } public int getSize(){ return size; ... 阅读全文

posted @ 2018-11-09 11:49 猪猪🐷

OOD 3 (big class)
摘要:// builder pattern // some fields are mandatory., some of them are optional // hard to intisalize all the constructors to take care of all the cases // solution 1 : // so use setter/getters // ... 阅读全文

posted @ 2018-11-09 11:48 猪猪🐷

ood 4 (big class)
摘要:ODD4 棋牌类的 我己经晕了, 换个类型 public enum Suit{ Club; Diamond; Heart; Spade; } public class Card{ private int faceValue; // 1 for A, 11 for J, 12 for Q, 13 for K. or we can use enum here pr... 阅读全文

posted @ 2018-11-09 11:47 猪猪🐷

ood1
摘要:public class Employee{ static double bonusRate = 0.1; final String name; final String id; int age; int salary; int level; Employee(String name, int age, String id, int le... 阅读全文

posted @ 2018-11-08 17:07 猪猪🐷

ood nov 2018
摘要:ood Take it slow , if you understand it, u don’t have to memorize it. The more you understand a thing , the less you need to memorize it Odd standard 阅读全文

posted @ 2018-11-08 17:06 猪猪🐷

导航