Java Language Specification

This category is to learn and describe the concepts mentioned in the Java Language Specification.

Java Virtual Machine Startup

In the last post we had a brief idea about the memory model of the Java Virtual Machine. We also came across certain terms like the Creation, Linking, Loading and Initialization of classes. In this post we will try to improve our understanding of all these terms. At the Java Virtual Machine Startup The JVM starts up by creating an initial class and loads it using the bootstrap class loader (we will learn about the class loader in another post). Some implementation of the JVM allow us to pass the name of the initial class using the command line. The JVM then links this initial class. L...
Read More

Memory Layout of Java Virtual Machine

The Java Virtual Machine is an abstract computing machine. It is responsible for most of the features which made Java a great technology. Few of the major selling points of Java was: Platform Independence Hardware Independence Operating System Independence Security from malicious programs It is said to be abstract computing machine because it offers all the specification which if implemented properly can act as a machine to execute instructions. Sun Microsystems (now acquired by Oracle) offers an implementation of the JVM. The JVM understands a particular binary forma...
Read More

Interface Declarations in Java

Introduction The previous post introduced Class Declarations in Java and it is the obvious next step to understand the Interface Declarations in Java after that. So, here is an insight to Interfaces in Java. Interfaces are considered as the way to achieve multiple inheritance in Java. We will certainly talk about that part in the coming sections. This post will introduce you to Interfaces and will also mention about the Annotations, which are different categories of interfaces and an important feature of the language. Multiple Inheritance Multiple Inheritance is a language construct w...
Read More

Class Declarations in Java

Introduction As promised here is the continuation of Understanding Java Classes. We will mostly discuss about the production rule for Class Declarations in Java. If you recall, in the previous post I mentioned about the below rule: NormalClassDeclaration: ClassModifiersopt class Identifier TypeParametersopt Superopt Interfacesopt ClassBody Do not worry, if you have no idea about what production rules of a grammar are. I will define them below and we do not need to know that as I will explain things in simple words. :) Dissecting the Production If you look at the above definition, we have...
Read More

Understanding Classes in Java

Introduction After gathering some insight into Java Reference Types in the previous posts, now understanding classes in Java has become easier. We need to understand how a Reference Type comes to existence and more. Apart from that we must also learn about Interfaces and Enums which are the building blocks of any written program. A Class in Java A class declaration defines a new reference type and describes its implementation. A class contains members which are enclosed in the body of the class. Members may also be inherited from a Super Class or Interfaces. A member can be a field, a...
Read More