Demo entry 6770300

Java

   

Submitted by anonymous on Nov 13, 2018 at 00:41
Language: Java. Code size: 284 Bytes.

 class Car {
 void run()
 {
 System.out.println("car is running");
 }
 }
 class Audi extends Car {
 void run()
 {
 System.out.prinltn("Audi is running safely with 100km");
 }
 public static void main(String args[])
 {
 Car b= new Audi();    //upcasting
 b.run();
 }
 }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).