Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

my query is i written one program in that print statement not printing

$
0
0
package program.java.scjp;

public class Animal1 {

String name;
public void eat()
{
System.out.println("generic eat method of animal");
}

public void printYourself(String n)
{
name=n;
System.out.println( "my name"+" "+ name);
System.out.println("oye iam here");
}
}
class Horse1 extends Animal1
{


public void printYourself()
{
String n = null;
System.out.println("Starting.....");
super.printYourself(n);

}
}



package program.java.scjp;

public class TestAnimal1 {

public static void main(String[] args)
{
Animal1 b=new Animal1();
b.eat();
b.printYourself("cat");

Horse1 n=new Horse1();
n.printYourself("dog");




}

}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>