java实现用户从键盘输入两个实数,输出它们的和
2020-12-17 01:09
标签:rgb test print oid ack static pack nbsp ble java实现用户从键盘输入两个实数,输出它们的和 标签:rgb test print oid ack static pack nbsp ble 原文地址:https://www.cnblogs.com/dss-99/p/14111726.html 1 //用户从键盘输入两个实数,输出它们的和
2 package classwork8;
3
4 import java.util.Scanner;
5
6 public class Double_test {
7
8 public static void main(String[] args) {
9 double x,y;
10 Scanner in=new Scanner(System.in);
11 x=in.nextDouble();
12 y=in.nextDouble();
13 Double a=new Double(x);
14 Double b=new Double(y);
15 System.out.println(a.sum(x, y));
16 System.out.println(b.sum(a, b));
17 }
18
19 }
上一篇:spring-batch入门
下一篇:【JAVA基础】封装