Comment on Tutorial - Method Overriding in Java By Henry



Comment Added by : Naveen Kumar

Comment Added at : 2011-04-30 18:44:55

Comment on Tutorial : Method Overriding in Java By Henry
/*Overridding & equals:--> Overriding is another useful feature of object-oriented programming technique. It provide the facility to redefine the inherit method of the super class by a subclass. The method overriding is used to invoking the parent class method by a child class. It is possible when a child class extends the parent class then all the attributes and the methods of parent class inherit by child class.*/

class Test10
{
int num,num1;
public Test10(int num,int num1)
{
this.num=num;
this.num1=num1;
}
public boolean equals(object 0)
{
Test10 t=(Test10)0;
if((t.num==this.num)&&(t.num1==this.num1))
{
return true;
}
return false;
}
public static void main(String[]args)
{
Test10 t1=new Test10(10,21);
Test10 t2=new Test10(10,30);
System.out.println(t1.equals(t2));
}
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Can u please help me to implement traversing forw
View Tutorial          By: Rahi at 2015-09-18 11:12:32

2. its very useful......to me
View Tutorial          By: dinesh at 2014-08-26 12:47:38

3. You have stretch it more then enough even then the
View Tutorial          By: Chirag at 2012-12-04 16:15:13

4. hi this is from iniyan....
can you send t

View Tutorial          By: iniyan at 2007-09-09 06:50:18

5. thanks for your tutorial, but how to us it?

View Tutorial          By: Desman Gea at 2014-07-18 16:54:41

6. It's simply nice.
View Tutorial          By: ghani at 2011-07-01 07:18:35

7. grt tutorial
View Tutorial          By: sss at 2009-08-30 03:33:13

8. how to connect the database in servelet use to sta
View Tutorial          By: sudhir singh tomar at 2011-04-28 03:10:34

9. can you guys please help me in inserting values on
View Tutorial          By: Fariha at 2015-06-15 20:44:04

10. Answer for comment 5
this loop is work infi

View Tutorial          By: salman at 2013-03-10 07:30:53