Is there a simple way to call static methods / properties in java?

java:
public class App {
    public static String name = "grayVTouch";
    public static void say(){
        System.out.println(App.name);
    }
}

in the above calling methods, if the class name is changed, all related static calls need to be changed. It is troublesome. Is there a simple operation like PHP ?

PHP:
class Test {
    public static $name = "grayVTouch";
    public static function say(){
        // self 
        echo self::$name;
    }
}
Nov.04,2021

public class App {
    public static String name = "grayVTouch";
    public static void say(){
        System.out.println(name);
    }
}
Why not just write the

code like this? The meaning of self is not found at all.


does not seem to have. For the time being, you can modify only one place of the reference class
with the static import of
.
2 use IDE's refactor


when you modify it, your IDE should modify the referenced places as well. Don't worry about this

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e87a-4dabb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e87a-4dabb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?