Skip to content

Instantly share code, notes, and snippets.

@froilan-miranda
Created October 16, 2015 14:35
Show Gist options
  • Save froilan-miranda/5e63acbf61da3f668637 to your computer and use it in GitHub Desktop.
Save froilan-miranda/5e63acbf61da3f668637 to your computer and use it in GitHub Desktop.
Java Lab
Type Information
Step 1 - Create a base class
example: class A
Step 2 - Create 3 classes that extend the base class
example: class B extends A
Step 3 - Write a program that creates 10 random instances of the extended classes and loads them in an List that only accepts instances of the parent class.
Step 4 - Go through each object in the list, down cast it to its original type and call a method that object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment