run a method in an element of an Arraylist in java -
I want to know if there is a way to run an element in an array list, but I do not want to get it Do it together because it really changes the areas of element
thanks benny
According to all the comments, to make everything even more clear:
< Code> public class references {public static zero main (last string [] args) {final string origin = "one and only one"; Last list & lt; String & gt; List = New Arrestist & lt; String & gt; (); List.add (original); Final string copy = list.get (0); If (original == copy) {System.out.println ("Whoops, it actually has two references to the same object."); } Else {System.out.println ("References for a different objects? A copy?"); }}}
Run this square and see what this print is.
Comments
Post a Comment