Java – Basic Syntax

A basic Java program can be broken down into several constructs and elements. Typically, it can be characterized as a collection of objects, which communicate with each other by calling each other’s routines. The basic definitions of objects and classes are given below: Class A class can be described as a blueprint that portrays the … Read more

Java programming Remarks

The Java programming language is… • General-purpose: It is designed to be used for writing software in a wide variety of application domains, and lacks specialized features for any specific domain. • Class-based: Its object structure is defined in classes. Class instances always have those fields and methods specified in their class definitions. This is … Read more

Java Is Object-Oriented

To some, object-oriented programming (OOP) technique is merely a way of organizing programs, and it can be accomplished using any language. Working with a real object-oriented language and programming environment, however, enables you to take full advantage of object- oriented methodology and its capabilities of creating flexible, modular programs and reusing code. Many of Java’s … Read more

Java’s Past, Present, and Future

The Java language was developed at Sun Microsystems in 1991 as part of a research project to develop software for consumer electronics devices—television sets, VCRs, toasters, and the other sorts of machines you can buy at any department store. Java’s goals at that time were to be small, fast, efficient, and easily portable to a … Read more

What Is Java?

Java was originally a programming language invented by Sun Microsystems, by James Gosling. Today Oracle owns Sun, and therefore Java too. Java is thus Oracle’s trademark. Over time Java has evolved into more than just a language. It is a full platform with lots of standard APIs, open source APIs, tools, a big developer community … Read more

A Closer Look at the First Sample Program

Although Example.java is quite short, it includes several key features that are common to  all Java programs. Let’s closely examine each part of the program. The program begins with the following lines: /* This is a simple Java program. Call this file “Example.java”. */ This is a comment. Like most other programming languages, Java lets … Read more

Compiling the Program

To compile the Example program, execute the compiler, javac, specifying the name of the source file on the command line, as shown here: C:\>javac Example.java The javac compiler creates a file called Example.class that contains the bytecode version of the program. As discussed earlier, the Java bytecode is the intermediate representation of your program that … Read more