publicclassTest {}Whatistheprototypeofthedefaultconstructor?()A.Test()B.Test(void)C.publicTest()D.publicTest(void)E.publicvoidTest()

题目
publicclassTest {}Whatistheprototypeofthedefaultconstructor?()

A.Test()

B.Test(void)

C.publicTest()

D.publicTest(void)

E.publicvoidTest()


相似考题
参考答案和解析
参考答案:C
ThecorrectanswertothisquestionisC.Thedefaultconstructoralwaystakesthesameaccessoftheclass.Inthiscase,theclassispublicandsodoesthedefaultconstructor.
更多“publicclassTest {}Whatistheprototypeofthedefaultconstructor?() ”相关问题
  • 第1题:

    下列( )选项的java源文件代码片段是不正确的。

    A.package testpackage; publicClass Test{}

    B.import java.io.*; package testpackage: publicClass Test{}

    C.import java.io.*; Class Person{} publicClass Test{}

    D.import java.io.*; import java.awt.*; publicClass Test{}


    正确答案:B

  • 第2题:

    在下列源代码文件Test.java中, ( )是正确的类定义。

    A.public class test{

    B.public class Test{ public int x=0;public int x=0; public test (intx) public Test (int x){ {this.x=x; this.x=x;} }} }

    C.public class Test extends T1,T2{

    D.protected class Test extends T2{ public int=0;public int x=0; public Test(int x){Public Test (int x){ this.x=x;this.x=x: }} }}


    正确答案:B

  • 第3题:

    指明程序的错误,并书写修改后的正确代码。 public class Test{ public static void method(int x){ } public static void method(int y){return y; } }


    正确

  • 第4题:

    下列哪个选项的java源文件程序段是不正确的? ( )

    A.package testpackage; public class Test{ }

    B.import java.io.*; package testpackage; public class Test{ }

    C.import java.i.*; class Person{} public class Test{ }

    D.import java.io.*; import java.awt.*; public class Test { }


    正确答案:B

  • 第5题:

    下面的哪些java源文件代码片断是对的?()

    A.package testpackage; public class Test{//do something...}

    B.import java.io.*; package testpackage; public class Test{// do something...}

    C.import java.io.*; class Person{// do something...} public class Test{// do something...}

    D.import java.io.*; import java.awt.*; public class Test{// do something..}


    package testpackage; public class Test{//do something...};import java.io.*; class Person{// do something...} public class Test{// do something...};import java.io.*; import java.awt.*; public class Test{// do something..}