Java认证考试

The file “file.txt” exists on the file system and contsins ASCII text.  Given:   try {   File f = new File(“file.txt”);    OutputStream out = new FileOutputStream(f, true);   }    catch (IOException) {}   What is the result?()A、 The code does not compile

题目

The file “file.txt” exists on the file system and contsins ASCII text.  Given:   try {   File f = new File(“file.txt”);    OutputStream out = new FileOutputStream(f, true);   }    catch (IOException) {}   What is the result?()

  • A、 The code does not compile.
  • B、 The code runs and no change is made to the file.
  • C、 The code runs and sets the length of the file to 0.
  • D、 An exception is thrown because the file is not closed.
  • E、 The code runs and deletes the file from the file system.
如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

An administrator suspects someone is modifying a sensitive file, and wants to log access information for this file.  Which of the following AIX component accomplishes this()

  • A、audit
  • B、syslog
  • C、TCB
  • D、sysck

正确答案:A

第2题:

You issue this statement:ALTER DATABASE BACKUP CONTROLFILE TO TRACE;  What does the statement generate?()

  • A、A text copy of the control file.
  • B、A binary copy of the control file.
  • C、A file containing a SQL statement which will re-create the database.
  • D、A file containing a SQL statement which will re-create the control file.

正确答案:D

第3题:

Use regex to remove all html tags from a file.


正确答案:
 

第4题:

You have lost datafile 4 from your database. Which is typically the fastest way to restore your database? ()

  • A、Restore and recover the datafile. 
  • B、Restore and recover the tablespace. 
  • C、Restore and recover the database. 
  • D、Restore and recover the control file. 
  • E、Restore and recover the parameter file.

正确答案:A

第5题:

A system administrator would like to verify the user definitions in the /etc/passwd file. Which of the following commands will accomplish this?()

  • A、usrck
  • B、sysck
  • C、lssec
  • D、lsuser

正确答案:A

第6题:

Using vi, you want to save changes to the file myfile with :w!, but vi complains it cannot write to the file. Therefore, you want to check the write permissions on the file. To do this without leaving vi, you type:()

  • A、 :!ls-I myfile
  • B、 :/ls-l myfile
  • C、 esc :Is -I myfile
  • D、 :?ls-l myfile

正确答案:A

第7题:

You develop a Web application that writes data to a file on a server. You restrict access to the file to specific Windows users. The Web application runs as CONTOSO/ASPNET. You deny anonymous access to the application in IIS. You add the following XML segment in the Web.config file. You need to ensure that the application meets the following requirements: 1. It must impersonate the user when it writes data to the file 2. It must run as CONTOSO/ASPNET when a user does not access the file. Which two actions should you perform?()

  • A、Use the following XML segment in the Web.config file.<identity impersonate="false"/>
  • B、 Use the following XML segment in the Web.config file.  <identity impersonate="true"/>
  • C、Use the following code segment to access the file. WindowsPrincipal wp =(WindowsPrincipal)HttpContext,Current.User;WindowsIdentity wt = (WindowsIdentity)wp.Idetity;WindowsImpersonationContext wic = wi.Impersonate();// Access The file herewic.Undo();
  • D、Use the following code segment to access the file. WindowsIdentity wi = WindowsIdetity.GetCurrent();WindowsImpersonationContext wic = WindowsIdentity.Impersonate(wi.Token);// Access the file herewic.Undo();

正确答案:A,C

第8题:

You are the administrator of a Windows 2000 Server computer. A folder named HR-Data on the system partition of the server is shared on the network as HR-Data. The owner of the HR-Data folder is Administrators.

The shared permissions and NTFS permissions are shown in the following table.

Share permissions:

Everyone: FULL Control

NTFS permissions

Domain Admins: Read

Katrin: Full Control

Katrin creates a file in the HR-Data folder. She sets the NTFS permissions for the file to list only herself on the access control list, with Full Control permission. Katrin then leaves on vacation and cannot be contacted.

Later, you discover that the file contains sensitive information and must be removed from the server as soon as possible. You want to delete the file without modifying any of the permissions for other files in the HR-Data folder. You want your actions to have least possible impact on users who may be using other files in the HR-Data folder. You want to use the minimum amount of authority necessary to delete the file.

What should you do?

A.Grant yourself Full Control permission for only the HR-data folder and not its subobjects. Delete the file. Then remove Full Control permission for HR-Data folder.

B.Take ownership of the HR-Data folder. When prompted, take ownership of the existing files. Grant yourself Full Control permission for the file. Delete the file.

C.Take ownership of the file. Grant yourself Modify permission for the file. Delete the file.

D.Grant yourself Modify permission for the HR-Data folder and its subobjects. Delete the file. Then remove Modify permission for the HR-Data folder.


正确答案:C
解析:Explanation:Tobeabletodeletethefileauserwithadministrativerightshastotaketheownershipofthefileandthengrantthemselfenoughpermissiontodeleteit.Incorrectanswers:A:TheadministratorisnotlistedontheDACLofthefile.Tochangethepermissionsonthefile,wemustfirsttakeownershipofthefile.B:Weshouldonlytakeownershipofthefile,notthefolder.D:Weshouldonlychangethepermissionsofthefile,notthefolder.

第9题:

An administrator received a call from a user whose PC crashed while using vi to edit a file. The user wants the edited file back. Where should the administrator look for the file()

  • A、/tmp
  • B、/var/preserve
  • C、/var/tmp/$USER
  • D、$HOME/.vi

正确答案:B

第10题:

The data file belonging to theSYSTEMtablespaceis corrupted and no backup of the file is available. How do you recover the data file?()

  • A、The data file cannot be recovered.
  • B、The date file can be restored from theSYSTEMauto backup.
  • C、Take thetablespaceoffline,drop,kand re-create it.
  • D、Recovery Manager (RMAN) is used to recover the data file.
  • E、The ALTER DATABSE CREATE DATAFILE..commandis used to recover the data file.

正确答案:A

更多相关问题