Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
java.
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; abstract class Shape{ abstract void draw(); } //In real scenario, implementation is provided by others i.e. unknown by end user class Rectangle extends Shape{ void draw(){System.out.println("drawing rectangle");} } class Circle1 extends Shape{ void draw(){System.out.println("drawing circle");} } //In real scenario, method is called by programmer or user class Rextester{ public static void main(String args[]){ Shape s=new Rectangle();//In real scenario, object is provided through method e.g. getShape() method s.draw(); } }
run
|
edit
|
history
|
help
0
4a
piglatin
Alllocate and release memory
Add Two Numbers saved in linked lists
Lexisort
Java
Java messing around
Java Functional Programming
Shortest distance between words
Java # Dizi ile ek bulma