Quick Index
Syntax


In a given language, the syntax is the way the language elements (e.g. words) are put together. The "rules" of the language. Let us look at examples.

English


English Syntax:


English Syntax Errors:


Java


Syntax has a similar meaning in Java.

Java Syntax:


Java Syntax Errors:


Fortunately, the Java compiler alerts us of syntax errors, allowing us to fix them before trying to run the program. This prevents the program from "blowing up" (i.e. "crashing").

Context


In programming, context means the "environment" that a given piece of programming "code" is running in.

Always know "where you are" (your context) when programming a piece of code.

Let us look at examples.

We have talked a lot about these two classes:

Student
	instance variables:
		firstName
		lastName
	
Rectangle
	instance variables:
		width
		height


So let us say we have constructed a Student object like this:
	a Student
		firstName = Yaping
		lastName = Deng


Example #1


Assume that we are "coding" (programming) in the Student class.

Description


"Context" will help us answer these questions. Tips

Hints

Solution