Comment on Tutorial - Method Overriding in Java By Henry



Comment Added by : Naveen Kumar

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

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. class Evaluate
{
public static void

View Tutorial          By: prajjawal at 2013-02-27 12:36:58

2. example is good but in more deatin & advanteg
View Tutorial          By: smita at 2010-08-08 06:09:09

3. Very helpful!!
View Tutorial          By: mahesh at 2012-07-12 06:24:50

4. Travis could you share steps to configure correctl
View Tutorial          By: Shailesh S. at 2015-09-09 09:36:20

5. hi ashraf , ramlak and all,
i m new here .

View Tutorial          By: hemendra at 2009-12-28 21:59:34

6. Using ForwardAction for Integration is Good, Which
View Tutorial          By: Ramesh Ram at 2013-06-05 17:57:25

7. i'm a student and new to all these HTML and JSP.
View Tutorial          By: sillee at 2009-08-13 03:22:14

8. This code rocks!! any one having any trouble shoul
View Tutorial          By: Ankur at 2010-01-22 06:37:10

9. good
View Tutorial          By: [email protected] at 2014-08-28 14:02:28

10. is it possible to import one user package inside a
View Tutorial          By: vivek imman at 2011-11-01 12:09:40