Java example of simple input computing function based on the handler object, using Canner
This example describes the Java simple input computing function based on the promise object. We will share this with you for your reference. The details are as follows:
Problem and code:
/** Copyright (c) 2015, Southwest University, School of information and design * All rights reserved. * file name: Computearea. java * Author: Gao Shuo * Completion Date: July 15, October 14, 2015 * version number: v1.0 * Problem description: Enter the radius to calculate the area. * Program input: radius. * Program output: area. */Package practice_01; import java. util. vertex; // token is the java. util packagepublic class Computearea {public static void main (String [] args) {// TODO Auto-generated method stub System. out. println ("helper house Test Result:"); // create a new jsonobject partition input = new partition (System. in); // enter the radius System. out. println ("please input the radius"); double radius = input. nextDouble (); double area = radius * 3.14; System. out. println ("the raisus is" + radius + "the area is" + area );}}
Running result:
Knowledge Point summary:
Create a sequence object for input. AndnextInt()
nextDouble()
Read different types.
Experience:
It is troublesome to input java data. First, read the fuse package and then create an object. Pay attention to the spaces in println output.
PS: Here are some recommended computing tools for your reference:
Calculation tool for online mona1 functions (equations:
Http://tools.jb51.net/jisuanqi/equ_jisuanqi
Scientific calculator online use _ advanced calculator online computing:
Http://tools.jb51.net/jisuanqi/jsqkexue
Online calculator _ standard calculator:
Http://tools.jb51.net/jisuanqi/jsq