On this page
  1. Object
  2. Availability
  3. Syntax & Overview
  4. Notes & Pitfalls
  5. Example

Object

Prev: builtins | Up: builtins | Next: `String`
Rel: builtins, Classes, Records & Sealed Hierarchies
Ref: Java Docs — Object
Tags: #public #prog #java #builtins #tier/core


Availability

Built-in / java.lang (java.lang Root Class) — available with zero import statements.

Syntax & Overview

public class Object  /* equals, hashCode, toString, getClass */

Root superclass of every reference type in Java.

Notes & Pitfalls

Example

Object a = "hello";
Object b = new String("hello");
assert a.equals(b); // value equality, not reference identity (a == b)

Linked from

Related notes