小编use*_*592的帖子

数组空指针异常错误

我继续我的学校项目,似乎遇到了另一个错误.所以发生的事情基本上是我收到一个空指针异常,即使代码看起来很好.我相信我的阵列出了问题,即使经过几个小时的搜索,我也无法找到错误.再一次,任何帮助/解决方案将不胜感激.

import java.util.*;

public class library {

private static students stu1 = new students(65435, "Bob", "Ted");
private static students stu2 = new students(45546, "Guy", "Sid");
private static students stu3 = new students(78688, "Tim", "Cas");
private static students stu4 = new students(45387, "Guy", "Jim");
private static students stu5 = new students(12367, "Dom", "Lam");
private static students stu6 = new students(45905, "Kid", "Loo");
private static students stu7 = new students(65484, "Mut", "Hum");
private static students stu8 = new students(34578, "Kim", "Hay");
private …
Run Code Online (Sandbox Code Playgroud)

java arrays class nullpointerexception

4
推荐指数
1
解决办法
4万
查看次数

标签 统计

arrays ×1

class ×1

java ×1

nullpointerexception ×1