.
Home About-us Privacy Policy Contact-us Services

Friday, October 23, 2015

Java - Method Overriding Program Example - Allprogramexample

ad+1

Method Overriding Program
class person
{
String name="Allprogramexample";
int age =23;
void result()
{
System.out.println("name is"+name+"age is"+age);
}}
class student extends person
{
int marks=1800;
void result()                      //method overrading
{
System.out.println("name is"+name+"age is"+age+"marks is "+marks);
}}
public class mov
{
public static void main(String aa[])
{
student obj1=new student();
obj1.result();
}}


0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates