Horje
down casting java Code Example
down casting java
public class Fruit{}  // parent class
public class Apple extends Fruit{}  // child class

public static void main(String args[]) {
    // The following is an implicit upcast:
    Fruit parent = new Apple();
    // The following is a downcast. Here, it works since the variable `parent` is
    // holding an instance of Apple:
    Apple child = (Apple)parent;
}




Java

Related
java check if 3 strings are equal Code Example java check if 3 strings are equal Code Example
Uri/Beecrowd Problem no - 1185 Solution in Java Code Example Uri/Beecrowd Problem no - 1185 Solution in Java Code Example
pass a list of string as PathVariable to api spring boot Code Example pass a list of string as PathVariable to api spring boot Code Example
java double buffering jpanel Code Example java double buffering jpanel Code Example
date.settime java Code Example date.settime java Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8