0

I have seen a question related to c#

How to create alias of System Constants class

Can you tell me does java provides similar feature

for eg.

System.out.println(sc.Hello); //see previous question
//here sc is the alias of class name SystemConstants sc

SystemConstants.java class

class SystemConstants
{
  public static final Hello = "Hello";
  public static final Youth = "Youth";
}
Community
  • 1
  • 1
yogeshkmrsoni
  • 133
  • 1
  • 1
  • 8

1 Answers1

0

As far as I know, there is not built-in alias system for class names in Java. If you have specific needs, introspection might help you, but if the matter is one of usability and easy coding, then it is probably overkill.

Eusebius
  • 531
  • 6
  • 24