• Home
  • Java
    • Java Basics
  • Kafka
    • Producer
  • AWS
  • GoLang
  • About Me
mjpric3@gmail.com
Curriculum Vitae

The Code Standard

  • Home
  • Java
    • Java Basics
  • Kafka
    • Producer
  • AWS
  • GoLang
  • About Me

What Is A Class

Basics

What is a Java Class?

There are two kinds of classes in Java. Concrete vs Abstract Classes

Characteristics of Concrete Classes

  1. Concrete Classes in Java, means they can be instantiated. Unless, a private access modifier has been added to the constructor within that class.

Characteristics of Abstract Classes

  1. Abstract Classes in Java, means the can not be instantiated.

Simply stated, a class in java is made up of a few parts. These parts consist of the following:

  1. Variables – A type of container that holds a value of a particular data type.
  2. Methods – Here is where the logic of your code and algorithms live

HelloWorld Example:

This class below declares a variable ‘message’ with a data type of String. (We will discuss data types in a later section). It then has a method called ‘printMessage’ wich prints the message that is passed out to the console.

 
 public class HelloWorld {
    String message = "Hello World";
 
    public void printMessage(String message) {
       System.out.println(message);
   }
}
 

Console Output: Hello World

You also might be interested in

Inheritance

Dec 22, 2018

is one of the four pillars of Java. Its purpose[...]

Abstraction

Jan 4, 2019

Abstraction is used to hide the implementation details of a particular[...]

What Is A Computer?

Dec 21, 2018

First we will start off with the dictionary definition of[...]

Recent Posts

  • Producer
  • Interfaces
  • Abstraction
  • Polymorphism
  • Conditional Statements

Categories

  • Basics
  • Kafka
  • Welcome

© 2025 · thecodestandard.com

Prev Next