Question: Question 1 6.25 pts Select the best answer. Consider this code snapshot: int a, e; short b, f; byte g; DataOutputStream c; DataInputStream d; ByteArrayOutStream


Question 1 6.25 pts Select the best answer. Consider this code snapshot: int a, e; short b, f; byte g; DataOutputStream c; DataInputStream d; ByteArrayOutStream X = new ByteArrayOutputStream(); c = new DataOutputStream(x); If I write a statement c.write(y, 0,8), y is most likely of type _____ None of these answers Obyte short int Obyte[] Question 2 6.25 pts Select the best answer. Consider this code snapshot: int a, e; short b, f; byte 8 DataOutputStream c; DataInputStream d; ByteArrayOutStream X = new ByteArrayOutputStream(); c = new DataOutputStream(x); Select the most likely valid statement to encode data to be sent out using TCP or UDP sockets. c.readint(a); c.writelnt(a); c.writelnt(b); O None of these answers O d.writeShort(b); Question 3 6.25 pts Select the best answer. Consider this code snapshot: String str = new String("C0456"); byte[] a = str.getBytes("UTF-16BE"); The content of a[3] is Invalid 54 00 None of these answers 68 Question 4 6.25 pts Select the best answer. Consider this code snapshot: String str = new String("C0456"); byte[] a = str.getBytes("UTF-16BE"); The content of a[4] is Invalid 67 None of these answers 00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
