In Java there’s a few different things; Objects, Classes and Variables to name a few.

In this post I’ll be explaining the difference between what an Object and an Object Variable is.

What is an Object?

An object is something that has a state and a behaviour. For example,  sparking water has different states. Temperature, clarity & fizzy-ness for example. The object is an instance of a Class. Likely a Class defining fluids or drinks.

Objects (to make things easier) have real world representations.

What is a Variable?

A variable, in Java, is something we can store things in, manipulate and reference.

For example, a plain piece of paper we might call “Paper 1”. On “Paper 1” we can store a girls phone number. We can also remove it when we realise she’s not into guys.

What’s the difference?

Objects tend to contain variables and methods. Variables are simply storage, but they not always inside of Objects.

Leave a Reply
You May Also Like

Databases & Database Management Systems: Introduction

Databases are used everywhere. Facebook, YouTube, your local library airport check-in desks,…

Introduction to Haskell Polymorphic Types & Basic Recursion

Polymorphic types are types that are “universally quantified in some way over…

Hack This Site: Realistic 1 Solution

This is a simple step-by-step solution guide for Realistic Mission 1 on…

Java Queue: How to Make a Queue (ADT) in Java

Java comes with some different datatypes you can use from the start.…