更多"public class Employee{&en"的相关试题:
[单项选择] As a Company employee you are the desktop administrator of a Windows 2000 Professional computer. The Windows 2000 Professional computer has 25 MB of free disk space drive C and 800 MB of free disks pace on drive E. You are unable to print large documents because if inadequate disk space on drive C. You want to be able to use the space on drive E to print large documents. What should you do? ()
A. From the Printer Properties dialog box, change the location field to E:/Winnt/System32/Spool/Printers
B. From the Print Server Properties dialog box, change the location of the spool folder to any existing file path on drive E
C. Copy the C:/Winnt/System32/Spool/Printers folder to the E:/Winnt/System32/Spool/Printers folder
D. Mount drive C as a subdirectory on drive E
[单项选择] A new employee needs access to a SQL Server 2005 database that is located on a server named SQL1. You create a login named ajones by using the following Transact-SQL statement. CREATE LOGIN ajones WITH PASSWORD = ’SQLServer$1’ The new employee reports that when he logs in, he receives the following error message: "Login failed. The user is not associated with a trusted SQL Server connection." You need to resolve the error and allow the new employee to gain access to SQL1. What should you do?()
A. Change the SQL Server security mode from Windows Authentication mode to SQL Server and Windows authentication mode.
B. Change the SQL Server security mode from SQL Server and Windows Authentication mode to Windows authentication mode.
C. Ensure that the login name is created with square brackets ([]).
D. Give the login access to a specific database by using the CREATE USER Transact-SQL statement.
[单项选择] 1. public class Employee { 2. String name; 3. double baseSalary; 4. Employee(String name, double baseSalary) { 5. this.name = name; 6. this.baseSalary = baseSalary; 7. } 8. } And: 1. public class Salesperson extends Employee { 2. double commission; 3. public Salesperson(String name, double baseSalary, 4. double commission) { 5. // insert code here 6. } 7. } Which code, inserted at line 7, completes the Salesperson constructor?()
A. this.commission = commission;
B. superb(); commission = commission;
C. this.commission = commission; superb();
D. super(name, baseSalary); this.commission = commission;
E. super(); this.commission = commission;
F. this.commission = commission; super(name, baseSalary);
[单项选择] public class Employee{ private String name; public Employee(String name){ this.name = name; } public String getName(){ return name; } } public class Manager extends Employee{ public Manager(String name){ System.out.println(getName()); } } 执行语句new Manager(“smith”)后程序的输出是哪项?()
A. smith
B. null
C. 编译错误
D. name
[单项选择] public class Employee{ private String name; public Employee(String name){ this.name = name; } public String getName(){ return name; } } public class Manager extends Employee{ public Manager(String name){ System.out.println(getName()); } } 执行语句new Manager(“smith”)后程序的输出是哪项?()
A. smith
B. null
C. 编译错误
D. name
[多项选择] public class TestDemo{ private int x = 2; static int y = 3; public void method(){ final int i=100; int j = 10; class Cinner{ public void mymethod(){ //Here } } } } 在Here处可以访问的变量是哪些?()
A. x
B. y
C. i
D. j
[单项选择] public class MyLogger { private StringBuilder logger = new StringBuuilder(); public void log(String message, String user) { logger.append(message); logger.append(user); } } The programmer must guarantee that a single MyLogger object works properly for a multi-threaded system. How must this code be changed to be thread-safe?()
A. synchronize the log method
B. replace StringBuilder with StringBuffer
C. No change is necessary, the current MyLogger code is already thread-safe.
D. replace StringBuilder with just a String object and use the string concatenation (+=) within the log method
[单项选择] public class SyncTest ( private int x; private int y; private synchronized void setX (int i) (x=1;) private synchronized void setY (int i) (y=1;) public void setXY(int 1)(set X(i); setY(i);) public synchronized Boolean check() (return x !=y;) ) Under which conditions will check () return true when called from a different class?
A. Check() can never return true.
B. Check() can return true when setXY is called by multiple threads.
C. Check() can return true when multiple threads call setX and setY separately.
D. Check() can only return true if SyncTest is changed to allow x and y to be setseparately.
[单项选择] public class ItemTest { private final mt id; public ItemTest(int id) { this.id = id; } public void updateId(int newId) { id = newId; } public static void main(String[] args) { ItemTest fa = new ItemTest(42); fa.updateId(69); System.out.println(fa.id); } } What is the result?()
A. Compilation fails.
B. An exception is thrown at runtime.
C. The attribute id in the Item object remains unchanged.
D. The attribute id in the Item object is modified to the new value.
E. A new Item object is created with the preferred value in the id attribute.
[多项选择] public class TestFive { private int x; public void foo() { int current = x; x = current + 1; } public void go() { for(int i=0;i<5;i++) { new Thread() { public void run() { foo(); System.out.print(x + “, “); } }.start(); }}} Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5, ?()
A. Move the line 12 print statement into the foo() method.
B. Change line 7 to public synchronized void go() {.
C. Change the variable declaration on line 3 to private volatile int x;.
D. Wrap the code inside the foo() method with a synchronized( this ) block.
E. Wrap the for loop code inside the go() method with a synchronized block synchronized(this) { // for loop code here }.
[单项选择] 1. class Test { 2. private Demo d; 3. void start() { 4. d = new Demo(); 5. this.takeDemo(d); 6. } 7. 8. void takeDemo(Demo demo) { 9. demo = null; 10. demo = new Demo(); 11. } 12. } When is the Demo object, created on line 3, eligible for garbage collection?()
A. After line 5.
B. After line 9.
C. After the start() method completes.
D. When the takeDemo() method completes.
E. When the instance running this code is made eligible for garbage collection.
[单项选择] You want to access employee details contained in flat files as part of the EMPLOYEE table. You planto add a new column to the EMPLOYEE table to achieve this. Which data type would you use for the new column()
A. CLOB
B. BLOB
C. BFILE
D. LONG RAW