1. Home
  2. Computing & Technology
  3. Computer Certification
SCMAD Practice Test
20 Free SCMAD Practice Questions from Whizlabs.com

Question 6

A MIDlet tries to use a secure connection using the following fragment:

SecureConnection sc = (SecureConnection)
Connector.open("ssl://host.com:79");
InputStream is = sc.openInputStream();
OutputStream os = sc.openOutputStream();
os.write("\r\n".getBytes());
int ch = 0;
while(ch != -1) {
ch = is.read();
}
InputStream second = sc.openInputStream();
second.close();
is.close();
os.close();
sc.close();

Identify the behavior of the above fragment. (Select three)

a. The getSecurityInfo() method could be used to read the security information associated with this connection.

b.  The code will throw an IOException since input stream is opened twice.

c.  A CertificateException would be thrown if the secure connection could not be established due to certificate errors.

d.  A ConnectionNotFoundException would be thrown if the secure connection could not be established due to certificate errors.

Next page > Question 7

Explore Computer Certification
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Computer Certification

©2009 About.com, a part of The New York Times Company.

All rights reserved.