Object-oriented programming in Java is special in few places. First, comparing to C++, Java has a new language construct: interface.
Then, there is also primitive type wrapping (autoboxing, see below) which prepares objects representing primitive data like int (converted to Integer) or double (Double).
Wrapper classes have several additional methods which can be used when working with them. Also they are required when you want to store primitive data inside JDK-provided containers. Java also allows you to create anonymous classes basing on interfaces or classes, these classes are declared and created just in one place - place of definition. Another special case is Enum type which is a singleton class factory which can be used to assign attributes to enumeration values or to define a thread-safe singleton class. Each Java class can implement "main" static method which makes it runnable using for example "java" command. One of the most widely used standard for Java objects is JavaBeans which primary aim was to deliver reusable component framework.
- Lesson: Object-Oriented Programming Concepts
- Java 101: Object-oriented language basics, Part 1: Classes and objects
- Java OOPs Concepts
- 5 Reasons to Use Composition over Inheritance in Java and OOP
- Autoboxing and Unboxing
- Programming with typesafe enums and annotations in Java 5
- Use @Override liberally - on @Override annotation
- JavaBeans - Wikipedia.org
- "Java in a Nutshell - Chapter 3: Object-Oriented Programming in Java" book by David Flanagan