Java for Humans {Classes & Objects}

Lincoln W Daniel
HackerNoon.com

--

View Table of Contents | Download Supporting Code | Subscribe to ModernNerd Youtube Channel for Coding Videos | By Lincoln W Daniel

In your life, you’ve learned about many types of animals, people, buildings, sports, schools, and so on. In English class, we refer to these “people, places, or things” as nouns. In Java, we can refer to them as objects — you can think about objects in Java as you do about nouns in English.

Java programs revolve around objects like English sentences revolve around nouns. You can describe a noun with adjectives and you can describe an object with fields, otherwise known as attributes or instance variables. Nouns perform actions with verbs just as objects perform actions with functions, or methods.

As you know, there are three base types, or classes, of nouns — people, places, and things — and from those, you can make infinitely more classes of nouns. Java has a similar idea. There’s a single base class of objects from which we can make infinitely more classes.

In this chapter, you will learn what a class is in Java and how you can make an object from a class.

Why Classes Are Important & Useful

Java is the most widely used object-oriented programming (OOP) language in 2016. OOP is a programming model based on the concept of “objects which are simply data structures that have fields, or attributes, that hold information (data) about themselves and methods they…

--

--

Lincoln W Daniel
HackerNoon.com

Chief Bull @ BullAcademy.org ® Elevating writers @ ManyStories.com. Author @JavaForHumans Ex: Editor in Chief MarkGrowth (acq.), Engineer @Medium @GoPuff