Obscuring

Definition:A simple name may occur in contexts where it may potentially be interpreted as the name of a variable, a type,type parameter, or a package.(JLS-8).So it will be course to compile time error,will define as the obscuring.

This is another problem that arises due to sharing the same name for a variable and a class in Java.

//compile-time error in last line

public class A {
    public static void main(String[] args) {
        String System = "Obscuring Exsample";
        System.out.println(System);
    }
}

Solution:Use Proper Naming convention.

Comments

Post a Comment

Popular posts from this blog

Hibernate-1

Map Interface using Java

GIT & Version Controlling