首页 试题广场 > 试题详情
单选题

When is the text “Hi there”displayed? public class StaticTest{? ? static? ? {? ? ? ? System.out.println(“Hi there”);? ? }? ? public void print()? ? {? ? ? ? System.out.println(“Hello”);? ? }? ? public static void main(String args[])? ? {? ? ? ? StaticTest st1 = new StaticTest();? ? ? ? st1.print();? ? ? ? StaticTest st2 = new StaticTest();? ? ? ? st2.print();? ? }}

  • A.Never.
  • B.Each time a new object of type StaticTest is created.
  • C.Once when the class is loaded into the Java virtual machine.
  • D.Only when the main() method is executed.
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 3个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部