[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fXyh7m5jD4UPcHAedumRmNQnMlnJN7jISwBOgM1xy-po":3},{"answer":4,"createTime":5,"id":6,"options":7,"origin":12,"question":19,"related":20,"source":32,"type":63},[],"2024-06-01 12:43:31",147723924,[8,9,10,11],"void Sub(int x) {&hellip;&hellip;}","Sub(int x) {&hellip;&hellip;}","Sub Sub(int x) {&hellip;&hellip;}","int Sub(int x) {&hellip;&hellip;}",{"count":13,"courseId":14,"courseImg":15,"courseName":16,"workId":17,"workName":18},15,"8936a979824fb65537a3b944cd317db9","https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002Fa06310862f916d3c02e2889c5e007e4e.webp","Java程序设计","3568414e57e54b07b5e63fee3d4de819","6.2构造方法小测验","是类Sub的正确构造方法",[21,34,44,54,64,73,82,91,100,103],{"answer":22,"createTime":5,"id":23,"options":24,"question":31,"source":32,"type":33},[],147723916,[25,26,27,28,29,30],"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":35,"createTime":5,"id":36,"options":37,"question":43,"source":32,"type":33},[],147723917,[38,39,40,41,42],"默认构造方法初始化所有数据成员","默认构造方法有和它所在类相同的访问权限修饰符","默认构造方法调用其父类的无参构造方法","如果一个类没有无参构造方法,编译器会它创建一个默认构造方法","只有当一个类没有任何构造方法时,编译器会为它创建一个默认构造方法","关于Java的构造方法,下面哪些叙述是正确的?( )",{"answer":45,"createTime":5,"id":46,"options":47,"question":53,"source":32,"type":33},[],147723918,[48,49,50,51,52],"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":55,"createTime":5,"id":56,"options":57,"question":62,"source":32,"type":63},[],147723919,[58,59,60,61],"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":65,"createTime":5,"id":66,"options":67,"question":72,"source":32,"type":63},[],147723920,[68,69,70,71],"构造方法不可以进行方法重载","构造方法用来初始化该类新对象的成员变量","构造方法具有和类名相同的名称","构造方法不返回任何值","关于构造方法,下列错误的说法是( )",{"answer":74,"createTime":5,"id":75,"options":76,"question":81,"source":32,"type":63},[],147723921,[77,78,79,80],"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":83,"createTime":5,"id":84,"options":85,"question":90,"source":32,"type":63},[],147723922,[86,87,88,89],"charAt()","endsWith()","indexOf()","substring()","从一个字符串中取出指定位置的字符,采用String类中的( )方法",{"answer":92,"createTime":5,"id":93,"options":94,"question":99,"source":32,"type":63},[],147723923,[95,96,97,98],"'d'","true","3","5","下面代码段输出结果是( ).String str=&quot;Work hard for dreams&quot;;System.out.println(str.indexOf('h'))",{"answer":101,"createTime":5,"id":6,"options":102,"question":19,"source":32,"type":63},[],[8,9,10,11],{"answer":104,"createTime":5,"id":105,"options":106,"question":111,"source":32,"type":63},[],147723925,[107,108,109,110],"Java规定构造方法名与类名必须相同","Java规定构造方法没有返回值,但不用void声明","Java规定构造方法不可以重载","Java规定构造方法只能通过new自动调用","关于Java程序的构造方法,说法错误的是( )"]