关于我的问题的更多信息,在java数组中添加大型整数 [英] more info on my question, ADDING LARGE INTEGERS, in java arrays

查看:77
本文介绍了关于我的问题的更多信息,在java数组中添加大型整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助编写加法,减法等方法。


例如,add方法必须添加大量的整数,

比如2500 + 69587562.每个数字都单独输入下标。


这就是我到目前为止所做的。我创建了这个类,构造函数


公共类示例

{

private int []值;

private int min;

private int max;



扫描仪键=新扫描仪(System.in);


公示例()

{

值= 20;

min = 0;

max = 20;

}


public int ReadSize(int size)

{


System.out.println("输入数组的大小。)

size = key.nextInt();


for(int min = 0; min< size.length; min ++)

{

值[min] = key.nextInt();

}

}

I need help in writing the addition , subtraction etc. method.

eample the add method must add large intergers,
say 2500 + 69587562. each number is entered in the subscript individually.


this is what i have done so far.I created the class,constructors


public class Example
{
private int[] values;
private int min;
private int max;


Scanner Key= new Scanner(System.in);

public Example()
{
values=20;
min=0;
max=20;
}

public int ReadSize( int size)
{

System.out.println("Enter the size of the array.")
size=key.nextInt();

for(int min=0; min<size.length;min ++)
{
values[min]=key.nextInt();
}
}

推荐答案


我需要帮助编写加法,减法等方法。


例如,add方法必须添加大量的整数,

比如2500 + 69587562.每个数字都单独输入下标。


这就是我到目前为止所做的。我创建了这个类,构造函数


公共类示例

{

private int []值;

private int min;

private int max;



扫描仪键=新扫描仪(System.in);


公示例()

{

值= 20;

min = 0;

max = 20;

}


public int ReadSize(int size)

{


System.out.println("输入数组的大小。)

size = key.nextInt();


for(int min = 0; min< size.length; min ++)

{

值[min] = key.nextInt();

}

}
I need help in writing the addition , subtraction etc. method.

eample the add method must add large intergers,
say 2500 + 69587562. each number is entered in the subscript individually.


this is what i have done so far.I created the class,constructors


public class Example
{
private int[] values;
private int min;
private int max;


Scanner Key= new Scanner(System.in);

public Example()
{
values=20;
min=0;
max=20;
}

public int ReadSize( int size)
{

System.out.println("Enter the size of the array.")
size=key.nextInt();

for(int min=0; min<size.length;min ++)
{
values[min]=key.nextInt();
}
}



您希望下次发布co时使用代码标记德。您的构造函数未正确初始化该数组。如果你想让数组存储20个整数,你可以

You will want to use code tags next time when posting code. Your constructor does not correctly initialize the array. If you want the array to store 20 integers you do

展开 | 选择 | Wrap | 行号


如果您在同一问题上需要更多帮助,请在此相同的帖子中发帖为同一问题启动新线程
If you need more help on this same problem, post in this same thread instead of starting a new thread for the same problem



下次发布代码时,您将需要使用代码标记。您的构造函数未正确初始化该数组。如果你想让数组存储20个整数,你可以
You will want to use code tags next time when posting code. Your constructor does not correctly initialize the array. If you want the array to store 20 integers you do
展开 | 选择 | Wrap | 行号


这篇关于关于我的问题的更多信息,在java数组中添加大型整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆