Find null in a arraylist whose datatype is dynamic and sort it in java -
i'm saving data in list , data json object who's data based on user chooses in php side , datatype can vary , want check if list has null values , sort it. how can write custom comparator generic everytype of data.
you can't write custom comparator that's generic unless have common super class.
that super class have value can use compare.
to check if list has null value have iterate on , remove null elements manually.
Comments
Post a Comment