Java example of simple input computing function based on the handler object, using Canner

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.