When should you use objects Java?

Generally Object should only be used when dealing with a collection of elements of disparate or unknown type . This then usually is followed by instanceof and cast statements. Many APIs return Object when then can provide disparate types and some of this is a holdover from Java 4 and older prior to generics.

Sizin İçin Seçtik  Ziraat borsa ne kadar komisyon alıyor?

Leave a Reply

Your email address will not be published. Required fields are marked *