A: any class
B: only the Target class
C: any class in the test package
D: any class that extends Target
举一反三
- Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?() A: Aany class B: Bonly the Target class C: Cany class in the test package D: Dany class that extends Target
- 下列哪个选项的java源文件代码片段是不正确的 A: package testpackage; public class Test{ } B: import jav i *; package testpaekage; public class Test { } C: import javi*; class Person { } public class Test { } D: import javi*; import jav aw*; public class Test{ }
- 下列哪个选项的java源文件代码片段是不正确的( )。 A: package mypackage; public class Test{ } B: import java.io.*; class Person{ } C: C. import java.io.*; package mypackage; public class Test{ } D: import java.io.*;import java.awt.*;public class Test{ }
- 下面哪些代码段是正确的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...}
- 下面哪些代码段是正确的Java源程序?( ) A: import java.io.*; package testpackage; public class Test{/* do something... */} B: import java.io.*;class Person{/* do something... */}public class Test{/* do something... */} C: import java.io.*; import java.awt.*; public class Test{/* do something... */} D: package testpackage;public class Test{/* do something... */}
内容
- 0
有以下代码: package com; public class Test { ...么语句,可以获得Class对象?(多选)
- 1
下列有关类声明的代码片段,正确的是( )。 A: package school;import java.sql.*;private String name;class Student{} B: package school;class Student{}import java.sql.*; C: import java.sql.*;package school;class Student{} D: package school;import java.sql.*;class Student{}
- 2
(06-06)分析如下所示的Java代码,其中this关键字的意思是( )。 public class Test { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; //this关键字所在的行 } } Class Main{ Public static void main(String []args){ Test T1 = new Test(); T1.setname(“zhangsan”); } }
- 3
下列有关类声明的代码片段,哪一项是正确的?() A: import java.sql.*; package school; class Student{ } B: package school; import java.sql.*; class Student{ } C: package school; class Student{ } import java.sql.*; D: package school; import java.sql.*;private String name; class Student{ }
- 4
下面程序段中不正确的是( )。 A: package myPackage;public class A{} B: package myPackage; class B{ } C: package myPackage; import java.io.*; public class C{ } D: import java.awt.Color; package myPackage; class D{ }