I have a question. I have to process IP addresses and port numbers. Each packet contains source and destination IP, source and destination port. Let say a packet is (1.2.3.4, 5.6.7.8,22, 8080) So I can store them in two different data types.
String packet ="1.2.3.4, 5.6.7.8,22, 8080";
short[] packet={1,2,3,4,5,6,7,8,22, 8080}
Which one will take more memory and which one is more efficient for processing