Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners method over riding

Have Programming Question? Ask it here!
 
 
 


deepa gopalsamy
method over riding
1 Answer(s)      3 years ago
Posted in : Java Beginners


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


Advertisement
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 Tutorials/Questions & Answers:
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
Advertisements
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
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
Data over Voice Communication
Data over Voice Communication  I just Want to know that Data Over Voice communication is possible in India or Not, If not then Why. and If Yes then Why Please anyone give the answer
application over https
application over https   Hi. This questions might be very simple but I would like to create a simple servlet program and want to access using https... while accessing https over http
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 
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   how and where, we can define methods ? can u explain me with full programme and using comments
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
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
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   
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
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
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
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
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
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
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
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
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
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
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
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
The JDBC API to access a desktop database like Microsoft Access over the network.
The JDBC API to access a desktop database like Microsoft Access over the network.  How can I use the JDBC API to access a desktop database like Microsoft Access over the network
get method
get method   how to use get method: secure method is post method and most of use post method why use a get method
method question
method question  How do I figure out the difference in a method heading, a method body, and a method definition
Passing parameter over Form to BackingBean - Java Server Faces Questions
Passing parameter over Form to BackingBean  Dear User, i have problems concerning passing parametes from form to my backing bean. I have... here, my Bean Code. This is the form
Overview of VOIP/ Voice over Internet Protocol
emerging technology in news today is Voice over Internet Protocol or VoIP. Voice over internet protocol (VoIP) one of the is the newest technologies which uses... of telecommunication over the world. The enhanced features and the flexibility
Method Overloading
Method Overloading  In java can method be overloaded in different class
Method Overloading
Method Overloading  In java can method be overloaded in different class
A method getColumnCount.
A method getColumnCount.  There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set
Benefit of Spring Injection over Hibernate / JDBC w/Oracle
Benefit of Spring Injection over Hibernate / JDBC w/Oracle  Im new to Spring and am still trying to understand the advantages over using jdbc (I understand that Spring offers more than just db connectivity but focusing specificly
abstract method
abstract method  is final method is in abstract class
method name
method name  Is there any method which is equivalent to c++'s delay(int) function
Advertisements
 

 

 

DMCA.com