Class vs. Object in Java

Instructor: David Gloag

David has over 40 years of industry experience in software development and information technology and a bachelor of computer science

In this lesson, we'll take a look at Java, define classes and objects in Java, and explain some differences between the two. At the end, you should have a good understanding of these important Java ideas.

Within Our Reach

Have you ever heard the phrase, ''Reach out and touch someone?'' The interesting thing is that this is easier today than it has ever been. You can literally engage in conversation with someone half-way around the world. Now, you can't physically touch them, but you may be able to see them and exchange thoughts, feelings, and information.

A few decades ago this was not possible. But now, with the cellular, video, and messaging technologies available today, it's as easy as turning on your computer or mobile device. But what makes it all work? How much of it do we really understand? If you are like most people, you understand some, but not all. And you may recognize Java as one part of the puzzle.

What is Java?

Java is a high-level computer programming language used for many general purpose things, but more recently used for accessing the Internet. It is quite popular, existing on some three billion devices worldwide. Because of this, it is favored by many developers. The language dates back to 1991 when it was created by Sun Microsystems and originally named OAK. It found uses in the cell phones, tablets, and cable boxes of the time. But that didn't work out as well as anticipated and by 1999, it was updated for use with the Internet. Today, Java belongs to Oracle (purchased in 2009) and has become a significant part of the Internet access equation.

What is a Class in Java?

A class in Java is a template, a description of some information and the operations that can be performed on that information. This description exists in the code but doesn't yet exist physically. A class is one of the fundamental constructs of the Java programming language. In fact, even the simplest Java program has at least one class. Think of a class as similar to a blueprint for a house. It describes everything you need to build the house, the location of the rooms, the plumbing and electrical systems, and even the placement of the doors. But the house doesn't yet exist. You can't walk up and touch it.

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account