考虑如下类:public class Test {int j,k;public Test(int j ) {this(j,0);}public Test(int j, int k) {this.j=j;this.k=k;}}以下哪些可正确创建Test对象?
![](/upload/20220827/c85071da6ff0aadc10ebce6c25bb4f0d.png)
相似题目
-
public class test( public int aMethod()[ static int i=0; i++; return I; ) public static void main (String args){ test test = new test(); test.aMethod(); int j = test.aMethod(); System.out.printIn(j); ] } What is the result?()
-
public class test( public int aMethod()[ static int i=0; i++; return I; ) public static void main (String args[]){ test test = new test(); test.aMethod(); int j = test.aMethod(); System.out.printIn(j); ] } What is the result?()
-
public class Test { public int aMethod() { static int i = 0; i++; return i; } public static void main (String args[]) { Test test = new Test(); test.aMethod(); int j = test.aMethod(); System.out.println(j); } } What is the result?()
-
interface foo { int k = 0; } public class test implements Foo ( public static void main(String args) ( int i; Test test = new test (); i= test.k; i= Test.k; i= Foo.k; ) ) What is the result? ()
-
public class test ( public static void main(string args) { int 1= 0; while (i) { if (i==4) { break; } ++i; } } ) What is the value of i at line 10?()
-
public class Test { public static void main (String args) { class Foo { public int i = 3; } Object o = (Object) new Foo(); Foo foo = (Foo)o; System.out.printIn(foo. i); } } What is the result?()
-
类Test1定义如下:1.public class Test1{2. public float aMethod(float a,float b){ }3.4.}将以下哪种方法插入行3是不合法的。
-
public class Test {public int call(){static int i=0;i++;System.out.println(i);}public static void main(String args[]){Test test = new Test();test.call();}}
-
给定JAVA代码,如下:Class Parent{public void count() {System.out.println(10%3) ;}}public class Test extends Parent{public void count() {System.out.println(10/3) ;}public static void main(Stringargs[]) {Parent p = new Test() ;p.count() ;}}运行编译后,输出结果是()。
-
读代码:public class Test {public static void main (String args[]) {class Foo {public int i = 3;}Object o = (Object) new Foo();Foo foo = (Foo)o;System.out.println(foo.i);}}结果是:
-
给定java程序Test.java如下,编译运行,结果是( ) 。package com;class Test {protected void talk () {System.out.print(talk) ; }}给定Test 的子类Test2,代码如下:packagecom.util;import com.*;public class Test2 extends Test {public static void main (String[]args) {new Test2() .talk() ;}
-
给出如下类定义:public class test {test(int k) { }}如果要创建一个该类的对象,正确的语句是:
-
类Test1定义如下: 1. public class Test1{ 2. public float aMethod(float a, float b){ } 3. 4. } 将以下哪种方法插入行3是不合法的。( )
-
分析如下所示的Java代码,则选项中的说法正确的是( )。 class Parent{ public String name; public Parent(String pName){ this.name = pName; } } public class Test extends Parent { //1 public Test(String Name){ //2 name=\hello
-
类MyClass的定义如下:class MyClass{public:MyClass(){value=0;}SetVariable(int i){value=i;)pr
-
有如下程序:includeusing namespace std;Class Test{public:Test(){}Test(const Test&t){co
-
类MyClass的定义如下:class MyClass{public:MyClass(){value=0;}SetVariable(int i){value=i;}pr
-
有如下类定义: class Test { public: Test(){a=0;c=0;} //① int f(in
-
有如下程序:include<iostream>using namespace std;class Test{public:Test(){n+=2;}~Test(){n-
-
给定如下代码,下面可以作为该类的构造函数的是()public class Test {}
-
有如下类的定义:class sample { int n; public: sample (int i=0):n(i){ } void setValue(int n0); };下列关于setValue成员函数的实现中,正确的是()
-
已知有如下代码: import java.util.*; public class Test{ public static void main(); } }
-
类Test定义如下:class Test public static void main(string args) String s1="abc";String s2=new String(s1);if(s1==s2) System.out.println("s1==s2";if(s1.equals(s2)) System.out.println("s1.equals(s2)"); 那么程序的执行
-
33、试图编译和运行以下代码的结果是: class Base { private Base() { System.out.println(0); } public Base(int i) { System.out.println(i); } } public class Test extends Base { public Test() { super(1); }; public static void main(String argv[]){ Test t = new Test(); } }
推荐题目
- 上颌窦穿刺时要掌握好进针的:()
- 萘普生的化学名为()
- ():负责THDS网络及查询双机群集(联网)服务器的管理与维护,接到网络及查询双机群集(联网)服务器故障通知后,应尽快查明原因,及时恢复。
- 纤维素性炎常发生在()
- 心绞痛
- 到()年,发展中国家的工业化基本完成。
- ()对鉴别检验结论有异议的,应在收到鉴别检验报告之日起10日内向原鉴别检验机构申请复检,逾期不予受理。委托方对复检结论仍有异议的,可向鉴别检验机构的主管部门申请仲裁性鉴别检验,并由主管部门组织仲裁。复检和仲裁性鉴别检验的样品应从留样中抽取。主管部门组织的仲裁性鉴别检验结论为最终结论。
- 引起疖、痈的常见致病菌是()。
- 关于X2检验,下列叙述正确的是()
- 地下防水工程的混凝土结构构件无明显裂缝,裂缝宽度不大于0.20mm,且不渗水。按地下室建筑面积计算每500㎡裂缝数量不大于1条,满足抗渗和混凝土耐久性要求。()