Top 250+ Solved Advanced JAVA MCQ Questions Answer
Q. Which method is used to perform DML statements in JDBC?
a. execute()
b. executequery()
c. executeupdate()
d. executeresult()
Q. What is the disadvantage of Type-4 Native-Protocol Driver?
a. at client side, a separate driver is needed for each database.
b. type-4 driver is entirely written in java
c. the driver converts jdbc calls into vendor-specific database protocol
d. it does not support to read mysql data)
Q. In Inetaddress class which method returns the host name of IP address?
a. public string gethostname()
b. public string gethostaddress()
c. public string inetaddress getlocalhost()
d. none
Q. Which classes are used for connection less socket programming?
a. datagram socket
b. datagram packet
c. both a and b
d. none
Q. Which of these class is used to encapsulate IP address and DNS?
a. datagram packet
b. url
c. inetaddress
d. contenthandler
Q. Which of these is return type of getAddress method of DatagramPacket class?
a. findaddress()
b. getaddress()
c. address()
d. whois()
Q. Which of these method of DatagramPacket is used to find port number?
a. port()
b. getport()
c. findport()
d. receivedport()
Q. Which of these class is necessary to implement datagrams?DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE - 45PROF . SUPRIYA MANE www.dacc.edu.in
a. datagrampacket
b. datagramsocket
c. all of the mentioned
d. none of the mentioned
Q. Which of these method of DatagramPacket is used to find the port number?
a. port()
b. getport()
c. findport()
d. recieveport()
Q. Which of these method of DatagramPacket is used to obtain the byte array ofdata contained in a datagram?
a. getdata()
b. getbytes()
c. getarray()
d. recievebytes()
Q. Which of these method of DatagramPacket is used to find the length of bytearray?
a. getnumber()
b. length()
c. length()
d. getlength()