Java Programming Language Fundamentals Conclusion
This module covered a lot of territory relating to the fundamentals of the Java programming language.
You began the module by learning about the structure of Java program code. You then learned about the different data types used in Java, including arrays and strings. From there you found out how Java evaluates expressions. Finally, you wrapped up the module by learning about the different operators used to carry out operations such as assignment, addition, and subtraction.
This module discussed how the following terms relate to Java:
- Token: A token is the smallest code element in a program that is meaningful to the compiler.
- Identifier: An identifier is a token that represents a unique name for a variable, method, class, package, and any other named Java construct.
- Keywords: Keywords are special identifiers set aside as Java programming constructs. Typical keywords in Java include int, class, for, while, new, private, and switch, to name a few.
- Operator: An operator is a programming construct that performs an evaluation or computation on a data object or objects.
- Literals: Literals are constant values such as numbers and strings.
- Separators: Separators are symbols used to inform the Java compiler of how code elements are grouped.
- Comments: Comments are used to document code for the purposes of the programmer. Java supports three different types of comments:
- Variables: Variables are locations in memory that are used to store information. You can think of variables as storage containers designed to hold data of a certain type.
- Data types: Data types dictate the type of information that can be stored in a variable. Java supports a wide range of simple data types such as
Composite data types in Java are implemented as objects. An example of a composite data type is String.
- boolean, and
- char .
- Array : An array is a special construct in Java that allows you to store a list of items of the same data type.
- String: A string is a Java object that represents textual information. Although you can think of a string in Java as a series of characters, strings are implemented in the String class.
- Expression: An expression usually involves an equal sign
Understanding how Java handles data
The core of programming is code that manipulates data. As programmers we are interested in the organization of data and code. The organization of data is referred to as data structures. These structures can be static or dynamic in nature.
For example, the ages of a population can be stored in consecutive locations in a data structure known as an array. While the array data structure has a fixed size, the contents may or may not change. In this section, we will examine several different aspects of variables including:
- How they are declared
- Primitive data types versus objects
- Where they reside in memory
- How they are initialized
- Their scope and lifetime
Java Programming Language - Quiz