

What is Parcel? The parcelclass is designed as a high-performance IPC transport. A Parcel can contain both flattened data that will be unflattened on the other side of the IPC, and references to live IBinder objects that will result in the other side receiving a proxy IBinder connected with the original IBinder in the Parcel. So, In this example, we are going to learn how to implement the Kotlin Parcelable Array object to send the data from one activity to second activity. For example, we may be required to send an array of data, data could be an Integer, String, Long, Double, Float or any other custom data objects. We often required that we need to send some data to other activity.

This concept is very similar to what happens in C++ when we pass a pointer variable as an argument.We know that IPC (Inter Process Communication) between the activity is an extremely important part of any application development. After that when we did modifications to ‘parameterList’ then the same changes are made to the original ‘list’. When we passed this object to the modifyList function then the address 1000 is passed to it and the object ‘parameterList’ also starts pointing to the same location inside the memory as that of ‘list’ that is why we said that object references are passed by value in java. Let us assume that the Array list object that we created inside the main function points to an address 1000.

Output ArrayList after insertions: ĪrrayList after modifications: ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.Full Stack Development with React & Node JS(Live).OS DBMS CN for SDE Interview Preparation.Full Stack Development with React & Node JS (Live).Data Structure & Algorithm Classes (Live).
