Basic format of a variable declaration: - Java Object Oriented Design

Java examples for Object Oriented Design:Field

Introduction

type variable;

It's common to initialize variables when declaring them, so you'll often see:

type variable = initialValue; 
 

Field declarations can be preceded by modifiers. For example:

public static variable = initialValue; 
protected variable; 
private variable;

Related Tutorials