Home Answers Viewqa Java-Beginners method over riding

 
 


deepa gopalsamy
method over riding
1 Answer(s)      a year and 11 months ago
Posted in : Java Beginners

write a java program to compute volume of sphere and volume of cylinder using method over riding

View Answers

June 30, 2011 at 12:04 PM


class Sphere {
double volOFSphere;
Sphere(double r){
volOFSphere =(4*3.14*r*r*r)/3;
}
void volume() {
System.out.println("Volume of Sphere: " + volOFSphere);
}
}
class Cylinder extends Sphere {
double volOfCylinder;
Cylinder(double r,double h) {
super(r);
volOfCylinder = 3.14*r*r*h;
}
void volume(){
super.volume();
System.out.println("Volume of Cylinder: " + volOfCylinder);
}
}
class MethodOverriding{
public static void main(String args[]) {
Cylinder c = new Cylinder(10, 20);
c.volume();
}
}









Related Pages:
method over riding
method over riding  write a java program to compute volume of sphere and volume of cylinder using method over riding
Transmitting messages over net
Transmitting messages over net  A method whereby messages to be transmitted between computers are all sent to a central computer, which gathers them and routes them to the appropriate destinations is known as - 1. Message
VoIP - Voice Over Internet Protocol
VoIP - Voice Over Internet Protocol          Vioce Over Internet or VOIP For Short is Promising technology for delivering the voice information over the Internet
Method overriding
Method overriding  can a method declared in one package be over ridden in a different package?   A subclass in a different package can only override the non-final methods declared public or protected
How Voice over Internet Protocol (VoIP) Works
change your idea of making telephone calls. How does VoIP or voice over internet... signals into digital data which is then transmitted over the Internet.... It is still a mystery for them the how do voice over IP (VoIP) works
What is VOIP (Voice Over Internet Protocol)?
Are you eager to know "What is Voice over Internet Protocol"? The world... connected from any part of the world to any part. VOIP or Voice Over Internet Protocol... to make calls instead of traditional phone calls. VOIP (Voice Over Internet
Advantages of Servlets over CGI
Advantages of Servlets over CGI     ... on browser compatibility. Servlets have a number of advantages over CGI and other... of code. Platform independency of servlets provide a great advantages over
JavaScript fontColor method
the method fontColor() over any string instead of using the <font></font> tags. The fontcolor() method in JavaScript can be used to color strings... JavaScript fontColor method   
java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding
java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding
mouse over effects in css
mouse over effects in css  I have written a mouse over effect in CSS. But it is not working in HTML. Can any one suggest me? Thanks
Call UIViewController over RootViewController
Call UIViewController over RootViewController   Hi, i have created the window based application.. but not sure how to call the UIView over RootViewController. Thanks
hibernate over Jdbc
hibernate over Jdbc  Why use hibernate over Jdbc?   Hibernate provides lots of advantages over JDBC. Some of them are as below: 1) Hibernate is data base independent 2) Hibernate provides its own query language called
Installing programs over a network
Installing programs over a network  Hi, i want to write a java program that will allow me to install programs from a server to a client machine. Any help will be appreciated. Thanks
Installing programs over a network
Installing programs over a network  Hi, i want to write a java program that will allow me to install programs from a server to a client machine. Any help will be appreciated. Thanks
Installing programs over a network
Installing programs over a network  Hi, i want to write a java program that will allow me to install programs from a server to a client machine. Any help will be appreciated. Thanks
Installing programs over a network
Installing programs over a network  Hi, i want to write a java program that will allow me to install programs from a server to a client machine. Any help will be appreciated. Thanks
Installing programs over a network
Installing programs over a network  Hi, i want to write a java program that will allow me to install programs from a server to a client machine. Any help will be appreciated. Thanks
Installing programs over a network
Installing programs over a network  Hi, i want to write a java program that will allow me to install programs from a server to a client machine. Any help will be appreciated. Thanks
RMI over Internet - RMI
RMI over Internet  Hello I've made a project which utilizes rmi for communication. Problem: I am unable to communicate using rmi over internet 1)the clients cannot connect to me 2)I am using client side callbacks 
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
Image writing over URLConnection
Image writing over URLConnection  Hello, I am trying to write an image over an HttpURLConnection. I know how to write text but I am having real problems trying to write an image I have succeeded in writing to the local HD using
method
method  can you tell me how to write an abstract method called ucapan() for B2 class class A2{ void hello(){ system.out.println("hello from A2"); }} class B2 extends A2{ void hello(){ system.out.println("hello from B2
JavaScript toFixed method
applied toFixed() method over a digit "1234.567" and post decimal digit... since we have both values we can apply toFixed() method over it.  ... JavaScript toFixed method
why should we over ride hashCode(), when equals was over ride()?
why should we over ride hashCode(), when equals was over ride()?  why should we over ride hashCode(), when equals was over ride
What is the advantage of hibernate over JDBC?
What is the advantage of hibernate over JDBC?  HI, What is the advantage of hibernate over JDBC? thanks
What is the advantage of hibernate over JDBC?
What is the advantage of hibernate over JDBC?  HI, What is the advantage of hibernate over JDBC? thanks
How to iterate over a checkbox group
How to iterate over a checkbox group  Hi. I am new to using JQuery and would much appreciate your help. I have a form on which I've created 5..." groups. My plan of attack was to iterate over the MASTER checkbox group
VoIP Over Cable
VoIP Over Cable          Introduction of VoIP Over Cable Cable operators... and voice service over the same cable spectrum. Voice (and fax) service over
JavaScript strike method
strike() method over it. As shown in output that it has stroked the text input... JavaScript strike method       JavaScript strike() method can be used to strikethrough the string
JavaScript toPrecision method
into a 5 digit number.  If we apply toPrecision() method over... JavaScript toPrecision method       In JavaScript, toPrecision() method is used to convert a number
JavaScript reset() method
is to be reset and thereafter we have used method reset() over it. Here... JavaScript reset() method      ... : By using Reset button of HTML By using reset() method of JavaScript Example
Compression of rolled-over files using log4j
Compression of rolled-over files using log4j  How can I use log4j to rollover the log files on hourly basis and compress the rolled over files
a competitive study on cryptography techniques over block cipher
a competitive study on cryptography techniques over block cipher  i need "a competitive study on cryptography techniques over block cipher" project source code... plz reply to my post... for more information about this project
Image swap on mouse over and mouse move
Image swap on mouse over and mouse move  i tried the code , sent form u...But if there are 50 images and..i want swap images on mousse over and mouse out, then the code becomes very lengthy...so please give the code for multiple
Image swap on mouse over and mouse move
Image swap on mouse over and mouse move  i tried the code , sent form u...But if there are 50 images and..i want swap images on mousse over and mouse out, then the code becomes very lengthy...so please give the code for multiple
Installing programs over a network using java
Installing programs over a network using java  Hi, i want to write a java program that will allow me to install programs from a server to a client machine. Any help will be appreciated. Thanks
Java Remote Method Invocation (RMI)
Java Remote Method Invocation (RMI)       The Java Remote Method Invocation API, is application... for this implementation is known as Java Remote Method Protocol (JRMP). A CORBA version
VoIP Over WiFi
VoIP Over WiFi          A VoIP Over WiFi with work in Progress  The 802.11... in making VoIP run over WiFi -pesky little details like bandwidth assurance
UIPopOverController - Open a second PopOverController over first UIPopOverController
UIPopOverController - Open a second PopOverController over first UIPopOverController  How can i open a second UIPopoverController over my first UIPopoverController in my iPad application? Right now my first UIPopoverController
Swap images oon mouse over and mouse out
Swap images oon mouse over and mouse out  I have multiple images...i want to swap each image on mouse out and mouse over..   <html> <script language="javascript" type="text/javascript"> if(document.images
VoIP Over Wireless
VoIP Over Wireless          Voice over Wireless IP Combining VoIP with 802.11... communications, enabling companies to deploy and manage voice and data over
anyone willing to look over my code? (java)
anyone willing to look over my code? (java)  package inorder.without.cheats; import java.util.Arrays; import javax.swing.JOptionPane; public class InOrderWithOutCheats { public static void main(String[] args
method inside the method??
method inside the method??  can't we declare a method inside a method in java?? for eg: public class One { public static void main(String[] args) { One obj=new One(); One.add(); private static void add
PHP Factory Method
PHP Factory Method: It is very common problem that sometimes we need to change.... In this case factory pattern helps us a lot. The factory method is a class... factory methods instead of constructors because it has following benefits over
I want only one method goes to sleep but both method goes to sleep together
I want only one method goes to sleep but both method goes to sleep... want like a sleep() or any other method should be invoked between User's turn and Computer's turn. But when i call Sleep() before cpuPlay() method or after
I want only one method goes to sleep but both method goes to sleep together
I want only one method goes to sleep but both method goes to sleep... want like a sleep() or any other method should be invoked between User's turn and Computer's turn. But when i call Sleep() before cpuPlay() method or after
Method
Method       In this section, we will explore the concept of method in the reference of object oriented... and behaviors are defined by methods. Method : An brief introduction Methods
GoF Factory Method in writing GUIs - Java Tutorials
GoF Factory Method in writing GUIs 2003-07-14 The Java Specialists' Newsletter [Issue 074] - GoF Factory Method in writing GUIs Author: Dr. Heinz M..., even though it will be an optional standard in J2EE. GoF Factory Method

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.