[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fLFYNff7tbmhrfHoeMozjrmiLQF9hx4DniKVtuq5aB5w":3},{"answer":4,"createTime":5,"id":6,"options":7,"origin":12,"question":19,"related":20,"source":33,"type":64},[],"2024-11-10 11:51:44",165262379,[8,9,10,11],"Java规定构造方法名与类名必须相同","Java规定构造方法没有返回值,但不用void声明","Java规定构造方法不可以重载","Java规定构造方法只能通过new自动调用",{"count":13,"courseId":14,"courseImg":15,"courseName":16,"workId":17,"workName":18},15,"2f75b84df4586013836016d972032eaf","https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002F50df1640528a3d76f0004bffacf118c9.png","JAVA程序设计","456d55ee59ba4db78739794f85ca0160","6.2构造方法小测验","关于Java程序的构造方法,说法错误的是( )",[21,35,45,55,65,74,83,92,101,110],{"answer":22,"createTime":23,"id":24,"options":25,"question":32,"source":33,"type":34},[],"2024-11-10 11:51:43",165262370,[26,27,28,29,30,31],"private Bag( ){ }","void Bag( ){ }","Bag( float x,float y){ }","public Bag(String str){ }","bag(){ }","int Bag(){ }","定义如下Bag类,( )是合法的Bag类的构造方法.class Bag{ float size; float color;}","v1",1,{"answer":36,"createTime":5,"id":37,"options":38,"question":44,"source":33,"type":34},[],165262371,[39,40,41,42,43],"默认构造方法初始化所有数据成员","默认构造方法有和它所在类相同的访问权限修饰符","默认构造方法调用其父类的无参构造方法","如果一个类没有无参构造方法,编译器会它创建一个默认构造方法","只有当一个类没有任何构造方法时,编译器会为它创建一个默认构造方法","关于Java的构造方法,下面哪些叙述是正确的?( )",{"answer":46,"createTime":5,"id":47,"options":48,"question":54,"source":33,"type":34},[],165262372,[49,50,51,52,53],"private Person(){ }","Person(String name,int age){ }","person(String name,int age){ }","public Person(String name,int age,char sex){ }","public void Person(String name,int age,char sex){ }","下面( )是Person类的构造方法",{"answer":56,"createTime":5,"id":57,"options":58,"question":63,"source":33,"type":64},[],165262373,[59,60,61,62],"A.java","A.class","B.java","B.class","对于下面代码,正确的Java源程序文件名是( ).class A { void method1() { System.out.println(&quot;Method1 in class A&quot;); }}public class B { void method2() { System.out.println(&quot;Method2 in class B&quot;); } public static void main(String[] args) { System.out.println(&quot;main() inclass B&quot;); }}",0,{"answer":66,"createTime":5,"id":67,"options":68,"question":73,"source":33,"type":64},[],165262374,[69,70,71,72],"构造方法不可以进行方法重载","构造方法用来初始化该类新对象的成员变量","构造方法具有和类名相同的名称","构造方法不返回任何值","关于构造方法,下列错误的说法是( )",{"answer":75,"createTime":5,"id":76,"options":77,"question":82,"source":33,"type":64},[],165262375,[78,79,80,81],"public static void main(String args[ ]){ }","static public void main(String arg[ ]){ }","public static void main(String [ ]args){ }","static public void main(String args){ }","下面( )不是Java应用程序中main方法的合法定义",{"answer":84,"createTime":5,"id":85,"options":86,"question":91,"source":33,"type":64},[],165262376,[87,88,89,90],"charAt()","endsWith()","indexOf()","substring()","从一个字符串中取出指定位置的字符,采用String类中的( )方法",{"answer":93,"createTime":5,"id":94,"options":95,"question":100,"source":33,"type":64},[],165262377,[96,97,98,99],"'d'","true","3","5","下面代码段输出结果是( ).String str=&quot;Work hard for dreams&quot;;System.out.println(str.indexOf('h'))",{"answer":102,"createTime":5,"id":103,"options":104,"question":109,"source":33,"type":64},[],165262378,[105,106,107,108],"void Sub(int x) {&hellip;&hellip;}","Sub(int x) {&hellip;&hellip;}","Sub Sub(int x) {&hellip;&hellip;}","int Sub(int x) {&hellip;&hellip;}","是类Sub的正确构造方法",{"answer":111,"createTime":5,"id":6,"options":112,"question":19,"source":33,"type":64},[],[8,9,10,11]]