A simple Unicode escape trick
Do you think the following Java code can compile correctly?
public class HelloWorld {
public static void mainString args {
// This is the first single line comment \u0009\u000a\u000c\u002f\u002a#######
...
What is a Literal? A Literal in the Java source code is used to specify valuesconstants. In Java, we can specify values of the primitive types, the String type and the null type. null is a special type which does not have a name, we only have a value...
IO class of Java 25
Java 25 intrroduced a new class called IO in java.lang package, in order to avoid writing longer code when using System.out.println.
I found a difference in the behaviour from the System.out.println
Just try the following main ...
Data Types in Java
All the data types in Java have been categorized into two, primitive data types
and the reference data types.
The primitive types, also known as built-in types, are byte, short, int, long,
float, double, char and boolean.
The re...
Identifiers in Java
In the Java source code, we define/declare several entities. These entities are identifiable by some names. Identifiers are used to give names to the entities. These identifiers are used for naming the classes, interfaces, enums,...
Introduction
While working on a code, where I wanted to hide some part of the code by using the unicode escapes instead of the actual code, I accidentally discovered an undocumented feature which as been available since Java 16.
I like to call this...
We know that all final variables need initialization before they can be used.
So can we access a final variable before it is initialized?
Well, for the final instance variable and final class variable it is always
possible to access them before they...