Program:
class Room
{
int length,width;
Room(int a,int b)
{
length = a;
width = b;
}
void area()
{
int area = length*width;
System.out.println("The area of the room is " +area);
}
}
class roomvol extends Room
{
int height;
roomvol(int a,int b,int c)
{
super(a,b);
height = c;
}
void volume()
{
int volume = length*width*height;
System.out.println("The volume of the room is " +volume);
}
}
class inheritance3
{
public static void main(String args[])
{
roomvol room2 = new roomvol(10,40,20);
room2.area();
room2.volume();
}
}
Output:
nn@linuxmint ~ $ javac inheritance3.java
nn@linuxmint ~ $ java inheritance3
The area of the room is 400
The volume of the room is 8000
nn@linuxmint ~ $
class Room
{
int length,width;
Room(int a,int b)
{
length = a;
width = b;
}
void area()
{
int area = length*width;
System.out.println("The area of the room is " +area);
}
}
class roomvol extends Room
{
int height;
roomvol(int a,int b,int c)
{
super(a,b);
height = c;
}
void volume()
{
int volume = length*width*height;
System.out.println("The volume of the room is " +volume);
}
}
class inheritance3
{
public static void main(String args[])
{
roomvol room2 = new roomvol(10,40,20);
room2.area();
room2.volume();
}
}
Output:
nn@linuxmint ~ $ javac inheritance3.java
nn@linuxmint ~ $ java inheritance3
The area of the room is 400
The volume of the room is 8000
nn@linuxmint ~ $
Great and Useful Article.
ReplyDeleteJava Online Course
Java Online Training
Java EE training
Java Course in Chennai
Java Training in Chennai
Java Training Institutes in Chennai
Java Interview Questions
Java Interview Questions
It is really a great work and the way in which u r sharing the knowledge is excellent.Thanks for helping me to understand basic concepts. As a beginner in java programming your post help me a lot.Thanks for your informative article.java training in chennai | chennai's no.1 java training in chennai
ReplyDeletenice blog. thanks for sharing valuable information. It’s really good.Any one looking software courses nareshit is the best offline and online software training institute in Hyderabad and Chennai.
ReplyDeleteGood work sir, Thanks for the proper explanation about Inheritance . I found one of the good resource related JAVA and OOPS concepts. It is providing in-depth knowledge on JAVA and OOPS. which I am sharing a link with you where you can get more clear on JAVA and OOPS. To know more Just have a look at this link
ReplyDeleteJava Tutorial
Class and object
Inheritance
Polymorphism
Abstraction
Encapsulation
Linux Online training in India – Webtrackker Technology is providing the linux online training with 100% placement support. If you are looking for the BEST LINUX & UNIX Training Institute In india or linux online training from india, live project based LINUX & UNIX online training then you can contact to us.
ReplyDeletePython online training in India, RPA Online training in India, Salesforce online training in india, AWS online training in india, Cloud Computing Online Training in India, SAS Online Training in india, Hadoop online training in INDIA, Oracle DBA online training in India, SAP online Training In india, Linux Online training in India
This comment has been removed by the author.
ReplyDeleteIts really nice and informative.. Thanks for sharing
ReplyDeleteBest Web Design Training Institutes in Noida
Best Hadoop Training Institutes In Noida
Best Digital Marketing Training Institute in Noida
Sap Training Institute in Noida
Best Java Training Institute in Noida
SAP SD Training Institute in Noida
Best Auto CAD Training Institute In Noida
servicenow scripting Training in Noida,
ReplyDeleteServiceNow implementation Training in Noida
,
ServiceNow integration Training in Noida,
ServiceNow portal Training in Noida,
servicenow training institute in Noida
Best Servicenow Developer training institute in Noida
,
Best servicenow admin training institutes in Noida
This comment has been removed by the author.
ReplyDelete6-week summer course in Noida - 6 weeks The summer course plays a crucial role in shaping the career of young aspiring / informatics students. This training has been specifically introduced so that students can become familiar with current industrial culture and industrial needs. Webtrackker technology offers a 6-month training program for students / graduates that includes small and large projects.
ReplyDelete6-week summer course in Noida
Ajio Offers Promo Codes
ReplyDeleteAjio Offers on online shopping
Firstcry Promo Codes
Firstcry Deals & offers
Firstcry coupons codes
Firstcry Coupons Offers Promo Codes
Firstcry Offers on Kids shopping
Myntra promo codes
Myntra deals and offers
Myntra coupon codes
Myntra coupons offers promo codes
Myntra offers on online shopping
Nykaa Promo Codes
Nykaa Deals and offers
Nykaa Coupons codes
Nykaa coupons offers promo codes
Nykaa offers on online shopping
Flipkart promo codes
Flipkart deals & coupons
flipkart coupon code
flipkart coupons offer promo code
Amazon promo code
amazon offers
amazon offers and deals
amazon coupon code
amazon deal of the day
Ajio Promo Codes
ReplyDeleteAjio Coupons & Offers
Ajio Coupon codes
cleartrip promo codes
ReplyDeletecleartrip coupon code
cleartrip offers and deals
cleartrip deals
MMT promo Codes
MMT coupon codes
Makemytrip promo codes
makemytrip offers
makemytrip deals & offers
healthkart coupon code
healthkart promo codes
healthkart deals and offers
healthkart discount offers
bigbasket promo codes
bigbasket coupon codes
bigbasket offers
bigbasket coupon and deals
pizzahut promo code
pizzahut coupon codes
ReplyDeletepizzahut offers
pizzahut coupon and offers
hotels promo code
hotels coupon codes
hotel offers & deals
hotels discount offers
nearbuy coupon codes
nearbuy promo codes
nearbuy deals and offers
nearbuy discounts
zoomcar promo code
zoomcar coupon code
zoomcar offers on ride
zoomcar deals and offers
Your blog is very wonderful.very useful to me.
ReplyDeleteServiceNow Training in Hyderabad
Each department of CAD have specific programmes which, while completed could provide you with a recognisable qualification that could assist you get a job in anything design enterprise which you would really like.
ReplyDeleteAutoCAD training in Noida
AutoCAD training institute in Noida
Best AutoCAD training institute in Noida
Your blog is very genuine.Please visit our website.
ReplyDeleteServiceNow Training in Hyderabad
Video editing course in Noida
ReplyDeleteVideo editing training institute in Noida- Webtrackker Technology is and IT Training institute providing the Video editing course in Noida, FCP, Final Cut Pro Training in Noida. For more call us- 8802820025.
Video editing course in Noida
Company Address:
Webtrackker Technology
C- 67, Sector- 63, Noida
Phone: 01204330760, 8802820025
Email: info@webtrackker.com
Website: http://webtrackker.com/Best-training-institute-Video-editing-FCP-course-in-Noida.php
Cloud Computing Training In Noida
ReplyDeleteWebtrackker is IT based company in many countries. Webtrackker will provide you a real time projects based training on Cloud Computing. If you are looking for the Cloud computing training in Noida then you can join the webtrackker technology.
Cloud Computing Training In Noida , Cloud Computing Training center In Noida , Cloud Computing Training institute In Noida ,
Company Address:
Webtrackker Technology
C- 67, Sector- 63, Noida
Email: info@webtrackker.com
Website: www.webtrackker.com
http://webtrackker.com/Cloud-Computing-Training-Institutes-In-Noida.php
I am really happy with your blog because your article is very unique and powerful for new reader.
ReplyDeleteSelenium Training in Chennai | Selenium Training in Bangalore | Selenium Training in Pune
Good article.Thank you for sharing this blog please visit our website.
ReplyDeleteServiceNow Training in Hyderabad
rpa training institute in noida
ReplyDeleteBlockchain training institute in Noida
thank you your post was knowlable to me
ReplyDeleterpa training institute in noida
sas training institute in noida
hadoop training institute in noida
blokchain traninig institut noida
Best Java training Institute in Ahmedabad, Java courses curated by Industry Expert, Java programming classes with Hands on Real-time Project & 100% Job assistance.
ReplyDeleteAdvanced Java training in Ahmedabad
servicenow scripting Training in Noida
ReplyDeleterpa training institute in noida
sas training institute in noida
hadoop training institute in noida
blokchain traninig institute noida
click here for more information about the latest stuff oneplus c type jack
ReplyDeleteLike different elements of India, numerous oil and spices usually cross into making food. This effects in substances getting caught to the partitions of the filter out.
ReplyDeleteVisit here
http://kitchenware.ml
Best kitchen chimney installation and service
Auto clean chimney sevice in Faridabad
Useful Information, your blog is sharing unique information....
ReplyDeleteThanks for sharing!!!
java development company in ameerpet
java development company in kphb
java development company in gachibowli
I found this post interesting and worth reading. Thanks for sharing!!
ReplyDeleteDevOps Online Training
Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
ReplyDeletebest ios development companies in hyderabad
web designing company in Hyderabad
website designer in Hyderabad,
top mobile app development companies
ios mobile app development company
best java development companies in hyderabad
Certainly this information might be worthwhile and advantageous for numerous apprentices who are learning java. Keep up with this admirable work and continue sharing. Professional Web design services are provided by W3BMINDS- Website designer in Lucknow.
ReplyDeleteWeb development Company | Web design company
This comment has been removed by the author.
ReplyDeleteI am very happy when this blog post read because blog post written in good manner and write on good topic.
ReplyDeleteThanks for sharing valuable information
Java Training Institute in Noida
Its really nice and informative.. Thanks for sharing
ReplyDeleteMicrosoft Azure Training institute in Noida,
AWS Training Institute in Noida sector 16,
Cloud Computing Training Institute in noida sector 16,
Data science training institute in noida sector 16,
Data Science With machine learning training Institute in Noida sector 16,
Data Science With python training Institute in Noida sector 16,
Web-designing Training Institute in Noida sector 16,
Its really nice and informative.. Thanks for sharing
ReplyDeletesoftware-testing Training Institute in Noida sector 16,
Digital Marketing Training Institute in noida sector 16,
hadoop Training Institute in noida sector 16,
Java Training Institute in noida sector 16,
linux Training Institute in noida sector 16,
node.js Training Institute in noida sector 16,
openstack Training Institute in noida sector 16,
Oracle DBA Training Institute in noida sector 16,
Its really nice and informative.. Thanks for sharing
ReplyDeletePhp Training Institute in noida sector 16,
PlSql Training Institute in Noida sector 16,
Python Training Institute in Noida sector 16,
RPA Training Institute in Noida sector 16,
Salesforce Training Institute in Noida sector 16,
Sap fico Training Institute in Noida sector 16,
ERP Sap mm Training Institute in Noida Sector 16,
Sap Training Institute in Noida Sector 16,
SAS Training Institute in Noida Sector 16,
Blue Prism Training Institute in Noida,
Thank you so much for posting this. I really appreciate your work. Keep it up. Great work!
ReplyDeleteCEH Training In Hyderbad
ReplyDeleteThank you for sharing such great information very useful to us.
Java Training in Noida
Discount hotels deal online
ReplyDeleteHotels - Find the low-cost last minute hotels deals package on AirlineDeals.net. We offer the best discount hotels deal online. Book your last minute hotels deals package.
to get more - https://airlinedeals.net/hotels/
A model is a person with a function either to sell, show or market it industrial products (appreciably style garb in style indicates), or to serve as a visual useful resource for individuals who are creating works of artwork or to pose for images +919910294610.
ReplyDeleteWhatsapp number - 9910294610
Arvind Rawat model in Noida
Visit here
Arvind Rawat Model in Noida
Arvind Rawat Model in Noida
Best kitchen chimney installation and service in NCR
ReplyDeleteWhen cooking with oil, you will see the fact that smoke usually receives emitted in case you often uses the identical oil. Typically, these form of eating places have today's hoods as well as exhaust fans.
Visit here
Kitchen Chimney Repair Service in Noida
Kitchen Kitchen Chimney Repair Service in Vaishali
Kitchen Kitchen Chimney Repair Service in indirapuram
Kitchen Kitchen Chimney Repair Service in vasundhra
Kitchen Kitchen Chimney Repair Service in faridabad
url
http://kitchenware.ml/home/kitchen-chimney-repair-service-in-noida
http://kitchenware.ml/kitchen-chimney-repair-service-in-vaishali
http://kitchenware.ml/kitchen-chimney-repair-service-in-indirapuram
http://kitchenware.ml/kitchen-chimney-repair-service-in-vasundhra–
http://kitchenware.ml/kitchen-chimney-repair-service-in-faridabad
When cooking with oil, you will see the fact that smoke usually receives emitted in case you often uses the identical oil. Typically, these form of eating places have today's hoods as well as exhaust fans.
ReplyDeleteVisit here
Kitchen Chimney Repair Service in Noida
Kitchen Kitchen Chimney Repair Service in Vaishali
Kitchen Kitchen Chimney Repair Service in indirapuram
Kitchen Kitchen Chimney Repair Service in vasundhra
Kitchen Kitchen Chimney Repair Service in faridabad
Cheap airline tickets deal
ReplyDeleteAre you searching the best Airline Tickets & Last Minute Airline Flights in Nigeria? Get the best Best Airline Tickets & Last Minute Airline Flights at AirlineDeals with the low-cost price.
to get more - https://airlinedeals.net/flights/
andaman tour packages
ReplyDeleteandaman holiday packages
andaman tourism package
family tour package in andaman
Andaman tourism package
Discount hotels deal online
ReplyDeleteDiscount Hotels Deal Online - With airline deals you able to get cheap airline tickets deal, Package, last-minute airline flights, discount hotels deal online in last minutes with best affordable prices.
to get more - https://airlinedeals.net/last-minute-hotels-deals-package/
Discount hotels deal online
ReplyDeleteDiscount Hotels Deal Online - With airline deals you able to get cheap airline tickets deal, Package, last-minute airline flights, discount hotels deal online in last minutes with best affordable prices.
to get more - https://airlinedeals.net/last-minute-hotels-deals-package/
If you are looking for Self learning, Distance Education Courses are becoming increasingly popular as a mode of education and are being utilized by professionals and students from around the world, there are numerous possibilities for distance learning courses. Just go through this link:-
ReplyDeleteDistance Education Courses ,
Are you looking for Distance Learning Courses in India most of the students choose and apply, Talentedgenex there are many popular courses which attract the students for having distance education. For more info visit this site:- Distance learning courses in India ,
ReplyDeleteTalentedgenext Way of Online Learning, Distance Education, is an increasing number of becoming popular all over the world due as it has many benefits. For further details visit in this site:- Distance Education Website,
ReplyDeleteOnline BBA degree in India is one of the most popular couses for students who are keen to learn business statistics, communicating skills, marketing management, entrepreneurship and small business management, international business, etc. To know more, visit:
ReplyDeleteOnline BBA Degree in India,
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteSelenium Training in Electronic City
Great! Thanks for sharing such an amazing post and keep blogging...
ReplyDeleteDataScience Training In Hyderabad
Nice! thanks for giving such a good information
ReplyDeleteTableau Trainig In Hyderabad
Its help me to improve my knowledge and skills also.im really satisfied in this session.servicenow training in bangalore
ReplyDeleteThanks for providing the good post.
ReplyDeleteMachine Learning training in Pallikranai Chennai
Pytorch training in Pallikaranai chennai
Data science training in Pallikaranai
Python Training in Pallikaranai chennai
Deep learning with Pytorch training in Pallikaranai chennai
Bigdata training in Pallikaranai chennai
Your blog post is really very informative & interesting. Thanks for sharing. For more updates on online shopping Coupons & discount Codes please visit Ustraa Discount Coupons
ReplyDeleteNice...
ReplyDeletebitwise aptitude questions
how to hack flipkart legally
zenq interview questions
count ways to n'th stair(order does not matter)
zeus learning subjective test
ajax success redirect to another page with data
l&t type 2 coordination chart
html rollover image
hack android phone using cmd
how to hack internet speed upto 100mbps
Good...
ReplyDeleteinternships in chennai
winter internship mechanical engineering
internship for aeronautical engineering students in india 2019
kaashiv
list of architectural firms in chennai for internship
paid internships in pune for computer science students
diploma final year project topics for information technology
internship
data science internship report
inplant training
Hi,
ReplyDeleteNice Post, Thanks for sharing,
Are you a student of any University or College? Or do you have an email address with .edu? Any of either? If yes, then enjoy this cool initiative of Amazon Prime Student by Amazon.
Visit For More Information: Amazon Student Discount
Nice Blog !!..
ReplyDeleteIT Infrastructure Services
HRMS Services
JAVA Development Services
HR Management Services
Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up…
ReplyDeleteLooking for Hadoop Admin Training in Bangalore, learn from Softgen Infotech provide Hadoop Admin Training on online training and classroom training. Join today!