Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Test of UBB- CODE-Tag

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without -Tag
class Animal{
void play()
{System.out.println("Animal.play()"); };
void move()
{System.out.println("Animal.move()"); };
}
class Dog extends Animal{
//overriding in play / move method
void play()
{System.out.println("Dog.play()");};
void move()
{System.out.println("Dog.move()");};
void bark()
{System.out.println("Dog.bark()");};
}
public class TestPolymorphismOverriden1 {
public static void main(String args[ ]){
//(Late)Binding because the right object
//(Dog) will be assigned at run time
// to the Animal reference "d".
Dog d = new Dog();
d.play();
d.move();
d.bark();
}
}

With -Tag => Formatted printing
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the [ CODE ] tags in the new Jive forum. There's color highlighting and line numbers. Cool huh?
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!