In java, is there any data type similar to javascript object type where I can store stuff something like we do in javascript.
Here is an object and it contains three arrays inside:
var myObject = {"smsBody": [], "totalSMS": [], "sender": []};
I can push data to individual array items inside that object:
myObject.totalSMS.push("5");
myObject.totalSMS.push("10");
And then can loop over them to get whole data out of an array item:
for (var i = 0; i < myObject.totalSMS.length; i++) {
alert(myObject.totalSMS[i]);
}
Is there something similar in Java plz?