InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of these is a return type of getAddress() method of DatagramPacket class?(a) DatagramPacket(b) DatagramSocket(c) InetAddress(d) ServerSocketI had been asked this question in an interview for internship.I'd like to ask this question from Networking in division Serialization & Networking of Java |
|
Answer» The CORRECT OPTION is (C) InetAddress |
|
| 2. |
Which of these method of DatagramPacket class is used to find the destination address?(a) findAddress()(b) getAddress()(c) Address()(d) whois()This question was posed to me in an interview.My question is from Networking in chapter Serialization & Networking of Java |
|
Answer» Correct OPTION is (B) GETADDRESS() |
|
| 3. |
Which of these class must be used to send a datagram packets over a connection?(a) InetAdress(b) DatagramPacket(c) DatagramSocket(d) All of the mentionedThe question was asked in an interview.Question is taken from Networking in portion Serialization & Networking of Java |
|
Answer» The correct option is (d) All of the mentioned |
|
| 4. |
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() |
|
| 5. |
Which of these method of DatagramPacket is used to obtain the byte array of data contained in a datagram?(a) getData()(b) getBytes()(c) getArray()(d) recieveBytes()The question was asked at a job interview.The question is from Networking in portion Serialization & Networking of Java |
| Answer» | |
| 6. |
Which of these method of DatagramPacket is used to find the port number?(a) port()(b) getPort()(c) findPort()(d) recievePort()This question was posed to me in unit test.I want to ask this question from Networking topic in section Serialization & Networking of Java |
|
Answer» RIGHT CHOICE is (B) getPort() EXPLANATION: NONE. |
|
| 7. |
Which of these class is necessary to implement datagrams?(a) DatagramPacket(b) DatagramSocket(c) All of the mentioned(d) None of the mentionedI had been asked this question at a job interview.I would like to ask this question from Networking topic in portion Serialization & Networking of Java |
|
Answer» RIGHT OPTION is (C) All of the mentioned The BEST explanation: NONE. |
|
| 8. |
Which of these is a bundle of information passed between machines?(a) Mime(b) Cache(c) Datagrams(d) DatagramSocketThis question was addressed to me by my school teacher while I was bunking the class.The question is from Networking topic in chapter Serialization & Networking of Java |
|
Answer» RIGHT choice is (c) DATAGRAMS Explanation: The Datagrams are the BUNDLE of information PASSED between machines. |
|
| 9. |
Which of these methods is used to know the type of content used in the URL?(a) ContentType()(b) contentType()(c) getContentType()(d) GetContentType()I had been asked this question at a job interview.Question is from HttpResponse & URLConnection Class topic in section Serialization & Networking of Java |
|
Answer» The CORRECT ANSWER is (C) getContentType() |
|
| 10. |
Which of these methods is used to know when was the URL last modified?(a) LastModified()(b) getLastModified()(c) GetLastModified()(d) getlastModified()()The question was asked during an online interview.This question is from HttpResponse & URLConnection Class in section Serialization & Networking of Java |
|
Answer» RIGHT OPTION is (B) getLastModified() The EXPLANATION: NONE. |
|
| 11. |
Which of these transfer protocol must be used so that URL can be accessed by URLConnection class object?(a) http(b) https(c) Any Protocol can be used(d) None of the mentionedThis question was posed to me in semester exam.My question is from HttpResponse & URLConnection Class in division Serialization & Networking of Java |
|
Answer» Correct OPTION is (a) http |
|
| 12. |
Which of these is a wrapper around everything associated with a reply from an http server?(a) HTTP(b) HttpResponse(c) HttpRequest(d) httpserverI got this question in an online interview.My question comes from HttpResponse & URLConnection Class in division Serialization & Networking of Java |
|
Answer» The CORRECT option is (b) HttpResponse |
|
| 13. |
Which of these methods is used to know the full URL of an URL object?(a) fullHost()(b) getHost()(c) ExternalForm()(d) toExternalForm()I have been asked this question during an online exam.I would like to ask this question from URL Class topic in chapter Serialization & Networking of Java |
|
Answer» Right choice is (d) toExternalForm() |
|
| 14. |
Which of these methods is used to know host of an URL?(a) host()(b) getHost()(c) GetHost()(d) gethost()This question was posed to me during an interview for a job.My question comes from URL Class in chapter Serialization & Networking of Java |
|
Answer» CORRECT OPTION is (B) getHost() The EXPLANATION: NONE. |
|
| 15. |
Which of these exceptions is thrown by URL class’s constructors?(a) URLNotFound(b) URLSourceNotFound(c) MalformedURLException(d) URLNotFoundExceptionThis question was addressed to me in class test.The doubt is from URL Class topic in division Serialization & Networking of Java |
|
Answer» RIGHT CHOICE is (C) MalformedURLException Best EXPLANATION: NONE. |
|
| 16. |
What does URL stands for?(a) Uniform Resource Locator(b) Uniform Resource Latch(c) Universal Resource Locator(d) Universal Resource LatchThis question was addressed to me in a national level competition.Enquiry is from URL Class in section Serialization & Networking of Java |
|
Answer» Right ANSWER is (a) UNIFORM RESOURCE Locator |
|
| 17. |
Which of these method is used to start a server thread?(a) run()(b) start()(c) runThread()(d) startThread()The question was asked during an online exam.The doubt is from Networking in portion Serialization & Networking of Java |
|
Answer» Right CHOICE is (a) run() |
|
| 18. |
Which of these method of httpd class is used to write UrlCacheEntry object into local disk?(a) writeDiskCache()(b) writetoDisk()(c) writeCache()(d) writeDiskEntry()This question was addressed to me during an internship interview.The doubt is from Networking topic in division Serialization & Networking of Java |
|
Answer» Right answer is (a) writeDiskCache() |
|
| 19. |
Which of these variables stores the number of hits that are successfully served out of cache?(a) hits(b) hitstocache(c) hits_to_cache(d) hits.to.cacheI got this question in final exam.My enquiry is from Networking topic in division Serialization & Networking of Java |
| Answer» | |
| 20. |
Which of these method of httpd class is used to get report on each hit to HTTP server?(a) log()(b) logEntry()(c) logHttpd()(d) logResponse()The question was posed to me during an internship interview.My question is taken from Networking topic in portion Serialization & Networking of Java |
|
Answer» Right CHOICE is (B) logEntry() |
|
| 21. |
Which of these methods are used to find a URL from the cache of httpd?(a) findfromCache()(b) findFromCache()(c) serveFromCache()(d) getFromCache()I have been asked this question in an online interview.My doubt stems from Networking in chapter Serialization & Networking of Java |
|
Answer» The correct option is (c) serveFromCache() |
|
| 22. |
Which of these methods of httpd class is used to read data from the stream?(a) getDta()(b) GetResponse()(c) getStream()(d) getRawRequest()The question was asked during a job interview.The origin of the question is Networking topic in division Serialization & Networking of Java |
|
Answer» RIGHT option is (d) getRawRequest() Best explanation: The getRawRequest() method reads data froma STREAM until it gets TWO CONSECUTIVE newline CHARACTERS. |
|
| 23. |
Which of these is an instance variable of class httpd?(a) port(b) cache(c) log(d) All of the mentionedI got this question in unit test.I want to ask this question from Networking topic in section Serialization & Networking of Java |
|
Answer» The CORRECT CHOICE is (d) All of the mentioned |
|
| 24. |
Which of these method of MimeHeader is used to return the string equivalent of the values stores on MimeHeader?(a) string()(b) toString()(c) convertString()(d) getString()The question was asked in an interview.My question is taken from Networking in portion Serialization & Networking of Java |
|
Answer» Right option is (b) toString() |
|
| 25. |
Which of these methods is used to make raw MIME formatted string?(a) parse()(b) toString()(c) getString()(d) parseString()The question was asked in an interview for internship.Asked question is from Networking topic in chapter Serialization & Networking of Java |
|
Answer» Right ANSWER is (a) PARSE() |
|
| 26. |
Which of these class is used for operating on request from the client to the server?(a) http(b) httpDecoder(c) httpConnection(d) httpdThe question was asked in unit test.I'm obligated to ask this question of Networking in chapter Serialization & Networking of Java |
|
Answer» RIGHT ANSWER is (d) httpd For EXPLANATION: NONE. |
|
| 27. |
Which of these is a standard for communicating multimedia content over email?(a) http(b) https(c) Mime(d) httpdThis question was posed to me during an interview.The doubt is from Networking topic in division Serialization & Networking of Java |
|
Answer» Correct answer is (c) Mime |
|
| 28. |
Which of these class is used to create servers that listen for either local or remote client programs?(a) httpServer(b) ServerSockets(c) MimeHeader(d) HttpResponseThe question was asked in homework.Question is taken from Networking in portion Serialization & Networking of Java |
|
Answer» The CORRECT OPTION is (B) ServerSockets |
|
| 29. |
Which of these class is used to create servers that listen for either local or remote client programs?(a) httpServer(b) ServerSockets(c) MimeHeader(d) HttpResponseI got this question in an interview for internship.This key question is from Networking in division Serialization & Networking of Java |
| Answer» | |
| 30. |
Which of these interface abstractes the output of messages from httpd?(a) LogMessage(b) LogResponse(c) Httpdserver(d) httpdResponseI have been asked this question during a job interview.I'd like to ask this question from Networking topic in portion Serialization & Networking of Java |
|
Answer» The CORRECT option is (a) LogMessage |
|
| 31. |
How many bits are in a single IP address?(a) 8(b) 16(c) 32(d) 64I have been asked this question in homework.My query is from Networking Basics topic in division Serialization & Networking of Java |
|
Answer» RIGHT answer is (c) 32 The BEST I can EXPLAIN: NONE. |
|
| 32. |
Which of these is a protocol for breaking and sending packets to an address across a network?(a) TCP/IP(b) DNS(c) Socket(d) Proxy ServerThe question was posed to me in an interview for job.My query is from Networking Basics in portion Serialization & Networking of Java |
|
Answer» RIGHT option is (a) TCP/IP Explanation: TCP/IP –Transfer control PROTOCOL/Internet Protocol is used to BREAK data into SMALL packets an send them to an address across a network. |
|
| 33. |
Which of these is a full form of DNS?(a) Data Network Service(b) Data Name Service(c) Domain Network Service(d) Domain Name ServiceI had been asked this question during an online interview.I would like to ask this question from Networking Basics topic in division Serialization & Networking of Java |
|
Answer» RIGHT CHOICE is (d) Domain Name Service Easiest EXPLANATION: NONE. |
|
| 34. |
How many ports of TCP/IP are reserved for specific protocols?(a) 10(b) 1024(c) 2048(d) 512The question was asked in an interview for job.This key question is from Networking Basics in section Serialization & Networking of Java |
| Answer» | |
| 35. |
Which of these package contains classes and interfaces for networking?(a) java.io(b) java.util(c) java.net(d) java.networkI had been asked this question during an online exam.My query is from Networking Basics in section Serialization & Networking of Java |
|
Answer» RIGHT OPTION is (C) java.net Easiest EXPLANATION: NONE. |
|
| 36. |
Which of these is a method of ObjectInput interface used to deserialize an object from a stream?(a) int read()(b) void close()(c) Object readObject()(d) Object WriteObject()I had been asked this question by my college professor while I was bunking the class.This interesting question is from Serialization & Deserialization in section Serialization & Networking of Java |
|
Answer» Correct ANSWER is (C) Object readObject() |
|
| 37. |
Which of these process occur automatically by java run time system?(a) Serialization(b) Memory allocation(c) Deserialization(d) All of the mentionedI had been asked this question by my school teacher while I was bunking the class.This key question is from Serialization & Deserialization in portion Serialization & Networking of Java |
|
Answer» CORRECT option is (d) All of the mentioned Easy explanation: SERIALIZATION, deserialization and Memory allocation occur automatically by java run TIME SYSTEM. |
|
| 38. |
Which of these interface extends DataInput interface?(a) Serializable(b) Externalization(c) ObjectOutput(d) ObjectInputI had been asked this question in quiz.The above asked question is from Serialization & Deserialization topic in portion Serialization & Networking of Java |
|
Answer» Correct OPTION is (d) OBJECTINPUT |
|
| 39. |
Which of these is a process of extracting/removing the state of an object from a stream?(a) Serialization(b) Externalization(c) File Filtering(d) DeserializationThis question was posed to me in my homework.My doubt is from Serialization & Deserialization in division Serialization & Networking of Java |
|
Answer» Correct CHOICE is (d) Deserialization |
|
| 40. |
Which of the following methods is not used while Serialization and DeSerialization?(a) readObject()(b) readExternal()(c) readWriteObject()(d) writeObject()I got this question during an interview.My enquiry is from Serialization in division Serialization & Networking of Java |
|
Answer» The CORRECT choice is (c) readWriteObject() |
|
| 41. |
Which of the following methods is used to avoid serialization of new class whose super class already implements Serialization?(a) writeObject()(b) readWriteObject()(c) writeReadObject()(d) unSerializaedObject()I have been asked this question by my school teacher while I was bunking the class.My query is from Serialization in division Serialization & Networking of Java |
|
Answer» CORRECT ANSWER is (a) writeObject() EXPLANATION: writeObject() and readObject() METHODS should be implemented to avoid Java serialization. |
|
| 42. |
Default Serialization process cannot be overridden.(a) True(b) FalseI got this question in a job interview.Query is from Serialization in portion Serialization & Networking of Java |
|
Answer» The CORRECT OPTION is (b) False |
|
| 43. |
If member does not implement serialization, which exception would be thrown?(a) RuntimeException(b) SerializableException(c) NotSerializableException(d) UnSerializedExceptionThis question was posed to me in an internship interview.My question is from Serialization in chapter Serialization & Networking of Java |
|
Answer» The CORRECT option is (C) NotSerializableException |
|
| 44. |
What type of members are not serialized?(a) Private(b) Protected(c) Static(d) ThrowableThis question was addressed to me in unit test.I want to ask this question from Serialization in chapter Serialization & Networking of Java |
|
Answer» CORRECT ANSWER is (c) STATIC The BEST explanation: All static and transient VARIABLES are not serialized. |
|
| 45. |
How many methods Serializable has?(a) 1(b) 2(c) 3(d) 0This question was posed to me in an interview for internship.My question is based upon Serialization in section Serialization & Networking of Java |
|
Answer» Correct OPTION is (d) 0 |
|
| 46. |
What is deserialization?(a) Turning object in memory into stream of bytes(b) Turning stream of bytes into an object in memory(c) Turning object in memory into stream of bits(d) Turning stream of bits into an object in memoryI have been asked this question during an online interview.My question comes from Serialization topic in division Serialization & Networking of Java |
|
Answer» The correct choice is (B) Turning STREAM of bytes into an object in memory |
|
| 47. |
What is serialization?(a) Turning object in memory into stream of bytes(b) Turning stream of bytes into an object in memory(c) Turning object in memory into stream of bits(d) Turning stream of bits into an object in memoryI got this question in class test.Enquiry is from Serialization in portion Serialization & Networking of Java |
|
Answer» The CORRECT option is (a) TURNING object in memory into stream of bytes |
|
| 48. |
How an object can become serializable?(a) If a class implements java.io.Serializable class(b) If a class or any superclass implements java.io.Serializable interface(c) Any object is serializable(d) No object is serializableI have been asked this question by my school principal while I was bunking the class.Enquiry is from Serialization in division Serialization & Networking of Java |
|
Answer» The correct CHOICE is (b) If a CLASS or any superclass implements java.io.SERIALIZABLE interface |
|
| 49. |
Which of these process occur automatically by the java runtime system?(a) Serialization(b) Garbage collection(c) File Filtering(d) All of the mentionedThe question was asked during an internship interview.This intriguing question originated from Serialization topic in division Serialization & Networking of Java |
|
Answer» Right OPTION is (a) Serialization |
|
| 50. |
Which of these is a method of ObjectOutput interface used to finalize the output state so that any buffers are cleared?(a) clear()(b) flush()(c) fflush()(d) close()The question was posed to me in homework.Origin of the question is Serialization in section Serialization & Networking of Java |
|
Answer» RIGHT ANSWER is (b) FLUSH() EASY explanation: None. |
|