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. Easy to understand........ thanks man
View Tutorial          By: vikash bhardwaj at 2013-06-25 07:07:54

2. thanks bro it helped me to answer my facu
View Tutorial          By: kasmin at 2010-01-08 08:11:32

3. HI I've been gettin this problem in STEP 6...How d
View Tutorial          By: Omar_sito12 at 2010-02-22 08:46:18

4. I've been learning C++/C for the past year or so,
View Tutorial          By: William Semple at 2013-01-05 17:53:30

5. plz xplian robust in a simple way and what is dyna
View Tutorial          By: tintu at 2011-12-01 08:21:25

6. short and very clear
View Tutorial          By: ramesh at 2009-07-22 22:27:25

7. setting on my nokia 7610 on mtn using operamini 4.
View Tutorial          By: DREAD at 2010-06-21 07:40:13

8. Thanks a lot. I've been stuck on this issue for qu
View Tutorial          By: Mark at 2008-04-12 22:01:56

9. hi to all i m getting this error plz solve it and
View Tutorial          By: krishna prasad at 2011-10-28 10:16:26

10. i Want Struts Full Details with
Word forma

View Tutorial          By: Kannan.R at 2007-10-04 00:40:27