首页/ 题库 / [单选题]

import java的答案

import java.io.IOException;  
public class ExceptionTest(  
public static void main (Stringargs) 
try (  
methodA();  
) catch (IOException e) (  
system.out.printIn(“Caught IOException”); 
) catch (Exception e) (  
system.out.printIn(“Caught Exception”);  
)  
)  
public void methodA () {  
throw new IOException (); 
}    
What is the result?()  

单选题
2022-01-04 17:18
A、 The code will not compile.
B、 The output is caught exception.
C、 The output is caught IOException.
D、 The program executes normally without printing a message.
查看答案

正确答案
A

试题解析

感兴趣题目
在下列程序的空白处,应填入的正确选项是(  )。import java.io.*; public class writeInt{ public static void main(String[] args){ int[] myArray={10,20,30,40}; try{ DataOutputStream dos=new DataOutputStream(new FileOutputStream("ints.dat")); for(int i=0;i dos.writeInt(myArray[i]); dos.close(); System.out.println("Have written binary file ints.dat"); } } catch(IOException ioe){ System.out.println("IOException"); } } }

Your boss, Miss ,is interested in CEF.
 What should you tell her? ()

数据库mydb中有关系表student,其结构如下: 
student(sno学号,sname姓名,sex性别,birthday生日) 
现编写一个学生信息浏览程序,设计界面和运行界面如下图所示:


在下划线处填写相应数据库组件的属性值: 
Database1. DatabaseName : mydb  
Table1. DatabaseName :  mydb  T
able1. TableName :  student 
Table1. Active :(①)          
Datasource1.DataSet :(②)         
DBNavigator1. DataSource : (③)         
DBEdit2. DataSource :(④)          
DBEdit2. DataField :(⑤)  

Your network contains an Active Directory domain. All servers run Windows Server 2008 R2.  
You need to audit the deletion of registry keys on each server.  
What should you do()

Sometimes performance is more important than availability (e.g., in cases where the data can be easily re-created). 
Which of the following is the appropriate disk configuration for an application that requires faster writes over availability()

根据写作要求,写出一篇作文。
You are Susan. Your company will hold an opening ceremony for a new factory. You are asked to write an invitation letter to David, an important client of your company. The following information should he included:the reasons to invite him; the time for the event;the place for the event;early reply expected. 

A customer is interested in reducing energy consumption and infrastructure consolidation for space. The customer needs a maximum of 14 servers in 7U rack. 
Which IBM BladeCenter Chassis should be recommended? ()

You are designing a top-level OU structure to meet the business and technical requirements. 
Which top-evel OU or OUs should you use? ()

You are employed as the Exchange administrator at Company.com.You are in the process of 
installing a new Exchange Server 2010 Organization.After the installation you send a text message to an external client and receive the subsequent non-delivery report (NDR): "Delivery has failed to these recipients or groups: [email protected] ([email protected]).The recipient’s e-mail system isn’t accepting messages now.Please try resending this message later or contact the recipient directly." You attempt to e-mail the user from an external e-mail system with great success.To ensure productivity you need to make sure e-mails can be sent to external clients from within the organization.
What should you do?()

A System p administrator in a manufacturing customer plans to migrate an AIX 5.2 system to a new LPAR on an existing System p using VIOS. 
Which of the following must be completed prior to this migration ()

You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005. You work as a database administrator for your company. There is a database named Inventory on a SQL Server 2005 computer, and the computer is named SQL01. SQL01 is utilized to aggregate manufacturing part numbers from your company’s trading partners. And the company stores the manufacturing part numbers in the Product table in the Inventory database. The company requests the users to deliver data as text files from each trading partner to SQL1 every night. The data should be imported, and no duplicate manufacturing part numbers should exist in the data which is imported from the text files, and the text files are stored in the Inventory database on SQL01. You should cut the effect on your company’s trading partners and your IT department to the least. 
Which action should you perform?()

import java.io.*; 
public class Forest implements Serializable { 
private Tree tree = new Tree(); 
public static void main(String [] args) { 
Forest f= new Forest(); 
try { 
FileOutputStream fs = new FileOutputStream(”Forest.ser”); 
ObjectOutputStream os = new ObjectOutputStream(fs); 
os.writeObject(f); os.close(); 
} catch (Exception ex) { ex.printStackTrace(); } 
} 
} 
class Tree { } 
What is the result?() 

相关题目

A System p administrator needs to run the annualreval.sh script, directing standard error to /var/log/reval.err, and appending standard out to /var/log/reval.log. 
How can this be accomplished ()

Refer to the exhibit. Users from the Engineering VLAN complain that every time Business VLAN users have a network connectivity issue, the Engineering VLAN users usually have problems experiencing slow response or network connectivity problems. After troubleshooting, an unauthorized switch 2 was found. This unauthorized switch has been a regular problem, assuming the root bridge function under the spanning-tree domain and causing the Engineering VLAN to be unstable. Which three of these actions could be suggested to fix the problem?()

You need to identify all failed logon attempts on the domain controllers.  
What should you do()

Assuming that the serializeBanana2() and the deserializeBanana2() methods will correctly use Java serialization and given: 
import java.io.*; 
class Food {Food() { System.out.print(”1”); } } 
class Fruit extends Food implements Serializable { 
Fruit() { System.out.print(”2”); } } 
public class Banana2 extends Fruit { int size = 42; 
public static void main(String [] args) { 
Banana2 b = new Banana2(); 
b.serializeBanana2(b); // assume correct serialization 
b = b.deserializeBanana2(b); // assume correct 
System.out.println(” restored “+ b.size + “ “); } 
// more Banana2 methods 
} 
What is the result?() 

在Java语言中,小明在他的包mypackage中定义了类My_Class, 在mypackage的子包mysubpackage中也有个类My_Class。小明用 import mypackage.*;引入包, 执行其中的语句: My_Class NewClass = new My_Class();时,将发生()。 

import java.util.*; 
public class PQ { 
public static void main(String[] args) { 
PriorityQueue pq = new PriorityQueue(); 
pq.add(”carrot”);
pq.add(”apple”); 
pq.add(”banana”); 
System.out.println(pq.poll() +”:” + pq.peek());
} 
} 
What is the result?() 

A customer wants to purchase an IBM System Storage DS8700 to support a high-performance database environment. 
Which technical solution gives the customer the best relationship between I/O performance at the machine’s backend vs. capacity installed in the machine()

现有:  
public interface A {}  
以下哪项声明是合法的?() 

现有: 
public interface A {}  
以下哪项声明是合法的?() 

import java.io.IOException;  
public class ExceptionTest(  
public static void main (Stringargs) 
try (  
methodA();  
) catch (IOException e) (  
system.out.printIn(“Caught IOException”); 
) catch (Exception e) (  
system.out.printIn(“Caught Exception”);  
)  
)  
public void methodA () {  
throw new IOException (); 
}    
What is the result?()  

在J2EE中,有如下代码在Servlet1.Java中   
Import javax.servlet.*;   
Import javax.servlet.http.*   
Import java.io.IOException;    
Import java.io.PrintWriter;   
Public class Servlet1 extends HttpServlet{ 
Public void init () throw ServletException {}  
Public void service(HttpServletRequest request, 
HttpServletResponce response) throws ServletException,IOException{ 
PrintWriter out=response.getWriter();  
Out.println(“hello!”); } } 
假如编译Servlet要具备的环境都已经建立好。现在用完全正确的命令编译该文件,对于以下成熟正确的是()  

You add an Online Responder to an Online Responder Array.  
You need to ensure that the new Online Responder resolves synchronization conflicts for all members of  the Array.  
What should you do()

Exhibit, One of the important tables in the USERStablespace was dropped and purged from the recycle bin at 9:00 a.m. You noticed this at 11:00 a.m. and you want to perform an incomplete recovery to recover the table. Which statement is true?()

View the Exhibit. 

One of the important tables in the USERS tablespace was dropped and purged from the recycle bin at 9:00 a.m. You noticed this at 11:00 a.m. and you want to perform an incomplete recovery to recover the table. 
Which statement is true?()

Company.com has a non-IBM disk storage unit connected by two Fibre channel connections. The  Nodes have multiple connections to the storage device that allow load balancing. A failure with one Fibre adapter or connection will not be noticed by the application, but it needs to be addressed. 
How can HACMP help make this environment more robust?()  

User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK,or any data definition language (DDL) command: 
SQL> SELECT job FROM emp 
2  WHERE job=’CLERK’ FOR UPDATE OF empno; 
SCOTT has opened another session to work with the database. Which three operations would wait when issued in SCOTT’s second session?()

User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK, or any data definition language (DDL) command: SQL> SELECT ename FROM emp 
2 WHERE job=’CLERK’ FOR UPDATE OF empno; 
SCOTT has opened another session to work with the database instance. 
Which three operations wouldwait when issued in SCOTT’s second session()

int index = 1; 
boolean[] test = new Boolean[3]; 
boolean foo= test [index];  
What is the result?()  

int index = 1;  
boolean test = new Boolean;  
boolean foo= test [index]; 
What is the result?()

在下列程序的空白处,应填入的正确选项是(  )。import java.io.*; public class ObjectStreamTest{ public static void main(string args[])throws IOException{ ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream("serial.bin")); Java.until.Date d=new Java.until.Date(); oos.______(); ObjectInputStream ois=new ObjectlnputStream(new FileOutputStream("serial.bin")); try{ java.until.date restoredDate=(Java.until.Date)ois.readObject(); System.out.println("read object back from serial.bin file:"+restoredDate); } catch(ClassNotFoundException cnf){ System.out.println("class not found"); } }
广告位招租WX:84302438

免费的网站请分享给朋友吧