1Primitive Type casting and Reference Type casting
2PRIMITIVE CASTING:
3implicit casting (casting smaller type to larger
4int a = 100; double c = a;)
5explicit casting (casting larger to smaller
6byte b = (byte) a;
7REFERENCE CASTING:
8upcasting - implicitly done (casting smaller type to larger)
9Collection<Integer> collection = new ArrayList<>();
10downcasting (cast larger type to smaller one )
11List <Integer> list = ( ArrayList ) collection;
12FRAMEWORK EXAMPLE:
13Up Casting, Down Casting in Multi Browser testing.
14WebDriver, Chrome Driver, Firefox Driver object
15I casted to WebDriver to making reference type.
16Whenever you taking Screenshots,
17whenever executing Java script command.
1Animal animal = new Dog ();
2animal.fetch(); // Compiler error
3(Dog) animal.fetch();