mdsk.net
当前位置:首页 >> jAvA改错一下代码 >>

jAvA改错一下代码

Java代码改什么错啊?人有罪是要悔改的,但是Java代码改错只会越改越乱,你想让宇宙的运行规律混乱不堪吗?那就需要我们打破宇宙的运作规律

int和int除法,得到是整除的结果,还是int,再强转为double。如果希望得到准确的double结果,最后一行改为: return ((double)sum)/((double)numbers.length)

1) n>100000...错了,改n

1 JAVA程序改错 1. abstract class Name { private String name; public abstract boolean isStupidName(String name) {} } 答案: 错。abstract method必须以分号结尾,且不带花括号。 2. public class Something { void doSomething () { priva...

这个代码怎么这么多错误啊 改了下: public class student { private static int count; private int Snumber; private int Sclass; private String Sname; private String Ssex; private int Sage; public student (int Snumber, int Sclass, S...

class Student { String name; int age; String sex; static String schoolName; static int sum=0; Student(String name,int age,String sex) { this.name=name; this.age=age; this.sex=sex; sum++; } void setName(String s) { name=s; } voi...

1.float z = 3.414;改为float z = 3;他是 2.String str1 = 'bye';改为String str1 = ”bye“;因为string是字符串不是字符,字符才用''。 3.c = "A";变量c不是字符串类型,他是字符 4.public static main(String[] args)缺少void,public static vo...

首先报错的原因在与你代码的第15行 for (int j = 1; j < 4; j++) { // 把j

public class Test { private String text; public Test(String s){ this.text = s; } public static void main(String[] args) { Test test =new Test("abc"); System.out.println(test.text.toLowerCase()); } }

public static void select_2 ( int[] arr ){for ( int x = 0; x < arr.length - 1; x++ ){int num = arr[x];int index = x;// 仔细看,是y,不是x啊,大姐节。。。for ( int y = x + 1; y < arr.length; y++ ){if (num < arr[y]){num = arr[y];...

网站首页 | 网站地图
All rights reserved Powered by www.mdsk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com