What are built-in classes and user-defined classes in Java?

In Java, all classes (built-in or user-defined) are (implicitly) subclasses of Object . Using an array of Object in the List class allows any kind of Object (an instance of any class) to be stored in the list. However, primitive types (int, char, etc) cannot be stored in the list.

Sizin İçin Seçtik  What is a class and method in Java?

Leave a Reply

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