Quick Java Tutorial

Learn the basics of Java programming. Covering variables, conditionals, loops, methods, classes, and objects.

Overview

On this page we will cover

Variables

/* Syntax: Type variableName = VALUE; */

int wholeNumber = 93;
double numberWithDigits = 46.85;

String text = "words and stuff";

boolean isValid = true;
boolean isNegative = -3 < 0;

MyObject obj = new MyObject();

Conditionals

Loops

Class Methods

Keywords:

Access Modifier keyword
Description

public

Method is accessible by any class

private

Method is accessible by the same class

protected

Method is accessible by the same class and any subclasses

[leave blank]

Method is accessible only by the class's object

Non-Access Modifier keyword
Description

static

Method belongs to class [Class.call()], not the object [object.call()]

abstract

Method must be overridden and does not have a body

final

Method cannot be overridden

Classes

Using Objects

Last updated

Was this helpful?