Compiler code

When we write a program in Java, we know that it gets converted to byte code, but before that compiler adds some intelligent code into our code. Let’s see what compiler will add 1) Extends Object class to our class 2) Default constructor if there are no constructor defined for a class 3) Adds this […]

Share this article on

Variable Hiding in Java

Variable hiding happens when there is another variable with the same name and it has nearest scope. Note : When local and global variables have the same name, local variables will take precedence than global variables. Consider the below program package com.kb.javainsimpleway.variable.hiding;   public class VariableHiding {     int x=100;     public static […]

Share this article on
< Previous Next >