class or method alias in java

前端 未结 8 1018
青春惊慌失措
青春惊慌失措 2020-12-10 00:31

I have long java class and method names

LONGGGGGGGGGGGGGGGClass.longggggggggggggggggggggggggMethod();

I want to alias it to g.m();

相关标签:
8条回答
  • 2020-12-10 01:07

    No.

    Wrap it in a method with a name you like better.

    0 讨论(0)
  • 2020-12-10 01:09

    I only ran a simple test but I defined an inner class variable. I'm not an expert nor do I know the consequences of doing this but I obtained positive results.

    package a.b;
    
    public class Library {
        public static String str;
    }
    

    Now write a class to access the static variables from Library

    package a.b;
    
    public class Access {
       public class Short extends Library {}
       Short.str;
    }
    
    0 讨论(0)
提交回复
热议问题