Java Language Specification

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

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

The Details of Object Class in Java

Introduction With some clarity in the Type Definition in Java, now it is time to know some details of the language. If you missed the critical posts in this series, please visit the link More about reference types in Java. In this post, I trust that you have knowledge about what I wrote in the above link. We will primarily discuss some core classes and their properties in the language. The Object class This Object class is a super class for all other classes. Please note that it is a super class only for all the classes, there are times when people get confused or have doubts if the inte...
Read More

More about Reference Types in Java

Introduction This post is about the Reference Types in Java and it is a continuation of the post Learning Java the Right Way. In the previous post we discussed about the Reference Types and Values. We will continue that discussion further. Also, the Java programming language has a lot to offer in terms of Generics, where it becomes almost mandatory to understand about the Types in detail. Type Declaration Identifiers and Type Names Now on, whenever we talk about the Types it would mostly be the Reference Types in Java. As Java is an object oriented language, even the primitive types h...
Read More

Learning Java the Right Way

Introduction It's been long that I read the Java® Language Specification Java SE 6 Edition but never thought of writing any post on that. Recently I started reading the Java® Language Specification Java SE 7 Edition and here I present my learning. This series is an effort for learning java the right way. directly from the source. It is the best practice, to learn a language from its specification. But most of the time when someone starts with the JLS, they get repelled by the first three chapters of the JLS, which is mostly about the Grammar and Lexical Structure of the Language. It mostly...
Read More