class Cat{}
class Computer{}
......
Object obj = need_a_cat? new Cat():new Computer();
......
Cat
and Computer
". That is correct ;).However still wondering why is a type checking required in the above case.
enum Day_Of_Week { sun, mon, tue ....}
String DoSomething(Day_Of_Week day) {
.......
}
....
DoSomething(Day_Of_Week.sun+109);
DoSomething(Day_Of_Week.sun+109);
should have failed during compilation. But it doesn't ;)
I am passionate about making Better Software Solutions,that helps businesses to stay agile, by applying Agile,Lean and Systems Thinking principles. Also I grow coffee,spices and in general has big interest in pesticide free food!
Subscribe to
Posts [Atom]