Area of a Circle without new Class and Math Class-Example0009 This example is example for using Scanner class to get input from user and calculate area of a circle. Using of Class Math is also shown Also casting from double to float is also shown package com.swprogramdeveloper; Keyword: java, aoc, scanner, user input, casting, math class import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here final float PI=3.14F; Scanner askinput= new Scanner(System.in); System.out.print("Please Enter Radius of the Circle:"); float radius= askinput.nextFloat(); //Using Mathematical expression float area= PI * radius * radius; System.out.print("Area of Circle(PIXRXR):"); System.out.println(...
Java Code which I learn step by step and I am posting each code I am practicing step by step, so will be useful to everybody. Java Coding made Easy. Java Code Examples - You can find here. Java Development and Java Progamming Examples This posting shows Java programs with explanation and adequate/lots of comments to understand what is going on. This is great for reading the Java code as well as to learn by example.