我不是Java的初学者,我需要弄清楚.. [英] I am less than a beginner at Java and I need to figure out..

查看:74
本文介绍了我不是Java的初学者,我需要弄清楚..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要显示总和和平均值而不初始化num和num2。我无法弄清楚这是在扼杀我。我似乎无法在不指定可变数值的情况下显示总和或平均值。有什么帮助吗?


------------------------------- -------------------

展开 | 选择 | Wrap < span class =codeDivider> | 行号

解决方案

< blockquote>你没有任何代码来计算总和或平均值。你是什​​么意思,你必须显示它们而不初始化num和num2? num和num2必须以某种方式得到一个值...


除了其他错误,你可以使这些变量成为静态类变量,所以

JVM会将它们初始化为零亲爱的。


亲切的问候,


Jos


我是java的新手我不知道如何使变量成为静态类。或者说实话其他任何事情。我做了一个教程,但没有帮助。


I need to display the sum and the average without initializing num and num2. I can''t figure it out and it''s killing me. I can''t seem to get the sum or average displayed without assigning the varables values. Any help?


--------------------------------------------------

Expand|Select|Wrap|Line Numbers

解决方案

You don''t have any code for calculating the sum or the average. What do you mean, you have to display them without initializing num and num2? num and num2 must get a value somehow...


Besides other errors you can make those variables static class variables so the
JVM will initialize them to zero for you.

kind regards,

Jos


I''m really new to java and I don''t exactly know how to make the variables static classes. Or do anything else to be honest. I did a tutorial and it didn''t help.


这篇关于我不是Java的初学者,我需要弄清楚..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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