Question: what is the difference between tcp and udp in java?
Answer: In short, TCP is reliable and guaranteed but UDP is not guaranteed. ... TCP provides ordering guaranteed which means the message will be received in the same order they are sent, UDP protocol doesn't provide such guarantee. TCP is a connection-oriented protocol as compared to UDP which is connectionless.