It will not affect the speed of the program, because the compiler will anyway replace the name of the variables with full paths. For example,
package aug; import static java.lang.System.out; public class MyClass { public static void main(String[] args) { out.println("abc"); } }
If you look at the decompiler:
package aug; public class MyClass { public MyClass() { } public static void main(String[] args) { System.out.println("abc"); } }
Part of bytecode:
public static main([Ljava/lang/String;)V L0 LINENUMBER 7 L0 GETSTATIC java/lang/System.out : Ljava/io/PrintStream; LDC "abc" INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/String;)V L1 LINENUMBER 8 L1 RETURN L2 LOCALVARIABLE args [Ljava/lang/String; L0 L2 0 MAXSTACK = 2 MAXLOCALS = 1 }