class
students
{
private int sno;
private String sname;
public void setstud(int no,String name)
{
sno = no;
sname = name;
}
public void putstud()
{
System.out.println("Student No : " + sno);
System.out.println("Student Name : " + sname);
}
}
class
marks extends students
{
protected int mark1,mark2;
public void setmarks(int m1,int m2)
{
mark1 = m1;
mark2 = m2;
}
public void putmarks()
{
System.out.println("Mark1 : "
+ mark1);
System.out.println("Mark2
: " + mark2);
}
}
class
finaltot extends marks
{
private int total;
public void calc()
{
total = mark1 + mark2;
}
public void puttotal()
{
System.out.println("Total
: " + total);
}
public static void main(String args[])
{
finaltot f = new finaltot();
f.setstud(100,"Nithya");
f.setmarks(78,89);
f.calc();
f.putstud();
f.putmarks();
f.puttotal();
}
}
Its easy to understand the programme and very easy to learn .thanks to sharing this article .
ReplyDeletejava training center in chennai | java training institute in chennai
awesome....thanks
ReplyDeleteI believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
ReplyDeleteSelenium training in Chennai
Selenium training in Bangalore
It's very helpful to ne, thank you
ReplyDeleteAfter reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
ReplyDeleteThank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in
Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
I Regreat For Sharing The information The InFormation shared Is Very Valuable Please Keep Updating Us Time Just Went On Reading The Article Python Online Training AWS Online Training Hadoop Online Training Data Science Online Training
ReplyDeleteHello,
ReplyDeleteCould you tell me that how to take those name,marks as inputs in runtime using scanner?
Your info is really amazing with impressive content..Thanks for your information!!
ReplyDeleteandroid training in chennai
android online training in chennai
android training in bangalore
android training in hyderabad
android Training in coimbatore
android training
android online training
i expect some more details information in hadoop, i am beginner in hadoop i have lots of doubts in that if you put your post with clean examples it will be more fine thank you...
ReplyDeleteSalesforce Training in Chennai
Salesforce Online Training in Chennai
Salesforce Training in Bangalore
Salesforce Training in Hyderabad
Salesforce training in ameerpet
Salesforce Training in Pune
Salesforce Online Training
Salesforce Training