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



Home Answers Viewqa Java-Beginners area of a circle

Have Programming Question? Ask it here!
 
 
 


alak
area of a circle
2 Answer(s)      5 years and 2 months ago
Posted in : Java Beginners



Advertisement
View Answers

June 6, 2009 at 9:50 AM


public class Circle;
{
char get data();
char area();
{
public static void main("Circle")
public static void main("Get data")
public static void main("Area")
}
}


June 12, 2009 at 3:59 PM


Hi Friend,

Try the following code:

class Circle
{
public double radius;
double pi=3.14;
public void getData(double radius)
{
this.radius=radius;
}
public double area()
{
double a = radius*radius;
double piValue= a*pi;
return piValue;
}
public static void main(String[] args)
{
Circle staticCircle = new Circle ();
staticCircle.getData(10);
double i = staticCircle.area();
System.out.println("The area is " + i);
}
}

Thanks
RoseIndia Team


Related Tutorials/Questions & Answers:
area of a circle - Java Beginners
area of a circle  Write a class circle which consists of functions getdata() and area(), and also write a main program to create a circle object and to find the area by calling the function area () in circle class and display
BlueJ (area of circle)
BlueJ (area of circle)  How does one write a program to calculate the area of a circle in BlueJ? Note that the user will have to provide the radius.   A simple program to calculate the area of a circle. radius provided
Advertisements
Method which returns area of circle - Java Beginners
Java code you can return the area of a circle and give the radius... of Circle : "+area); double perimeter = a.perimeterOfCircle(r...Method which returns area of circle  Need simple Java Method example
How to calculate area of Circle
How to Calculate Area of Circle   ... of calculating  the area of circle. In this program you will be taught each and every... the area of circle. After that it return the area of circle, return the doubles type
Write a program to calculate area and perimeter of a circle
Write a program to calculate area and perimeter of a circle... example will teach you the method for preparing a program to calculate the area and perimeter of a circle. First of all name a class as "CircleArea"
circle
circle  Program to test whether a given point lies inside a circle... of the circle : "); double r = input.nextDouble... of circle : "); double x1 = input.nextDouble(); System.out.print
Creating circle inside a circle
Creating circle inside a circle  hi can any one give code for following output by awt/swing creating circle inside a circle ,outside cirlce and intersect a circle
Java Circle to Circle collision detection
Java Circle to Circle collision detection  Java Circle to Circle collision detection
Circle question - Java Beginners
void calculate(Circle c){ double r=c.getRadius(); double area=pi*r*r; double...Circle question  Hey You helped me with one this question already... that uses Circle class you created in the previous assignment. ? The program
How to draw a circle bucket, draw a circle bucket, circle bucket
How to draw a circle bucket       This example has a simple way to learn easily to make a circle shape... style: Go to Layer menu > Layer style > Bevel and emboss. Draw Circle
setting RGB for a circle
setting RGB for a circle  how can i change the color of the circle(not through filling it) and i want to use RGB (not regular colors such as black or red..) i should include RGB numbers (for example 240, 150, 19) but i am
How do I handle the reaction of a circle and a semi-circle colliding in java?
How do I handle the reaction of a circle and a semi-circle colliding in java?  How do I handle the reaction of a circle and a semi-circle colliding in java
By using Applet display a circle in a rectangle
By using Applet display a circle in a rectangle  Write a java applet to display a circle in a rectangle
Text Area
Text Area  how to browse an image in text area instead of giving url of particular image
How to design a circle logo, design a circle logo, a circle logo
How to design a circle logo     ... will learn here a simple circle logo, I have not used tough steps so it is easy... a "Circle thin frame" by the Custom shape tool (U key) with any
Java GUI code- creating a circle
that prompts the user to enter the center and a point on the circle, which is (x,y)(x2,y2). The program should then output the circle's radius, circumference, and area. I did my code but I can't seem to figure out the mathematical code
How to Create Circle In Java
How to Create Circle In Java     ..., you will learn how to create Circle Diagram. The java circle is the most... the shape to enclose an area. The Java2D API  also provides several classes
Area Tag in html5, Definition of <area> tag in HTML5.
Area Tag in html5, Definition of  <area> tag in html5... in the html document. The <area> tag is used for creating an area...: The syntax for the <area> tag is as follows: <area
Java gui program for drawing rectangle and circle
gui program for drawing rectangle and circle? there shoud be circle.... and the program must also show message dialog "this is a red circle" when click circle button and red button. and same goes to "this is a red rectangle
MySQL Area
MySQL Area       This example illustrates how to find the area of rectangle in MySQL. In this example we create a procedure to find the area of rectangle. In the query below we take
bean area - SQL
bean area  how to print bean area in excel sheet from oracle forms
MySQL Area
MySQL Area  This example illustrates how to find the area of rectangle in MySQL. In this example we create a procedure to find the area of rectangle. In the query below we declare two integer type variable w and h with default
Flex Circle drawing example
Flex circle drawing example   ... and the button operator. The circle is not a default feature, the instructions for drawing a circle is defined inside the Sprite class of flash.display
Area Chart
Area Chart       In this section we are providing you an example to create a Area Chart. Description of Program For creating a Area Chart we use the object
How to calculate area of triangle
Area of Triangle       In this section we will learn how to calculate area of triangle. We are going to use area of triangle is half of the area of the parallelogram. Here
How to calculate area of rectangle
How to Calculate Area of Rectangle       In this section we will learn how to calculate area of rectangle. The area of rectangle is specifies an area in a coordinate space
Clip Area
Clip Area       This section illustrates you how to show the clipping of Area. A Clip... shows the clipping of area. In the given example, we have defined two buttons
HTML5 <area> href, hreflang attribute of area tag.
;area> tag in html5. href: The href attribute specifies the URL link for the area... are as follow: href_attribute_of_area_tag.html <!DOCTYPE 
Text Area in HTML
Text Area in HTML       Text  Area in HTML is used to write unlimited number of text in it. Understand with Example The Tutorial illustrate an example from Text Area
Rel attribute in area tag, Use of rel attribute in area tag.
Rel attribute in area tag, Use of rel attribute in area tag. In this tutorial, you will see the use of rel attribute of area tag and how to implement... : Declaration syntax of rel attribute in area tag.     
Find Cylinder area By inputting value from user
Find Cylinder area By inputting value from user  Hello Sir I need the code for calculating the area of a cylinder in which it asks radius value from user and then calculate area using this radius value. Please provide me
hybrid chart(Stacked Area and Line ) - Swing AWT
hybrid chart(Stacked Area and Line )  hello i have a problem... different chart stacked area chart and line chart both in a single frame... to display hybrid graph (Stacked Area and Line ).combination of stacked area chart
accepts the area of a square and will calculate its perimeter.
accepts the area of a square and will calculate its perimeter.  Develop a program that accepts the area of a square and will calculate its perimeter... input=new Scanner(System.in); System.out.println("Enter Area of Square
hello Deepak -how to highlight the area in image
hello Deepak -how to highlight the area in image  how to highlight the specific area in image,when the cursor is at corresponding field's textbox. Here webpage consist of a jpeg image on the top and below that manual fields(text
Auto grow Text Area using jQuery plug-in
Auto grow Text Area using jQuery plug-in  Hi sir How can we make a textarea auto grow ? What is the name of the plug-in used for auto grow text area. Please mention code with your reply
How to create an area chart using jfreecharts?
How to create an area chart using jfreecharts?  i want to create an area chart that represents ip addresses of top countries. i have gone thru the area chart example using jfreechart but i am still not clear with its method. If u
spell cheking in text area - JSP-Servlet
spell cheking in text area   Hi Good Morning. I am developing web application. Now i am in one JSP page. in this page i have 1 text area. i want spell check functionality by pressing right click in this text area.but i don't
how can i draw line between two panel contaning circle and line between their center?
how can i draw line between two panel contaning circle and line between their center?   how can i draw line between two panel contaning circle and line between their center
How to Create Text Area In Java
How to Create Text Area In Java       In this section, you will learn how to create Text Area in Java... and a text area is also created on the panel by using JTextArea class
Draw Clip Area Using Canvas
Draw Clip Area Using Canvas       This Example is going to draw a clip with SOLID line. In this picture only solid line show the clipping area. To draw a solid line, we have
Adding text in to text area of jframe at new line with different background colour
Adding text in to text area of jframe at new line with different background... that text in to text area of jframe.But i am reading line by line from file and i want to write that text every time at new line in text area with different background
How to use Bean Area in Oracle Forms 9i with Sample code ?
How to use Bean Area in Oracle Forms 9i with Sample code ?  Hi friend.I posted a query,but I didn't get the answer for it.Help me to resolve including a bean area in oracle forms 9i and using it in forms.Thanks in advance.Help me
HTML5 type attribute, Definition of type attribute in <area> tag.
of the linked resources. Declaration syntax: <area href="
Java method final parameter
. In the example the radius parameter for calculating the area of circle have been... = radius; } public void areaOfCircle(){ double area=PI*radius*radius; System.out.println("Area of Circle= "+area
Generate area for map from backing bean - Java Server Faces Questions
Generate area for map from backing bean  I need to populate the map in my page, and the coordinates should come from the backing bean.. How could I do
Auto grow Text Area using jQuery plug-in
Auto grow Text Area using jQuery plug-in In this section, you will learn how to create a text area which auto grow on increment of the content using jQuery Plug-in. We fixed the height of text area to 70 pixels .The size of the window
Create area chart in JSP page using JFreeChart
Create area chart in JSP page using JFreeChart       This Example shows you how to create a area chart in JSP page using JFreeChart. Code given below creates a area
display combination of a stacked area chart and line chart in one iframe using jfree - JSP-Servlet
display combination of a stacked area chart and line chart in one iframe using... to display combination of a stacked area chart and line chart in one iframe...://www.roseindia.net/chartgraphs/area-chart.shtml http://www.roseindia.net
java script to replace words starting and ending with tild(~) symbol in a text area with the word highlighted yellow.
java script to replace words starting and ending with tild(~) symbol in a text area with the word highlighted yellow.  Hi, I have an issue with highlighting text in a text area. I am designing a page to send email. currently
Advertisements
 

 

 

DMCA.com