1.

Which of these methods of DatagramPacket is used to find the length of byte array?(a) getnumber()(b) length()(c) Length()(d) getLength()This question was addressed to me by my college professor while I was bunking the class.My question is taken from Networking topic in section Serialization & Networking of Java

Answer»

Correct ANSWER is (d) GETLENGTH()

For explanation: getLength returns the length of the valid data contained in the byte array that would be returned from the getData () method. This typically is not equal to length of WHOLE byte array.



Discussion

No Comment Found

Related InterviewSolutions