是否可以从JavaScript中读取像httpRequest.getSession("attr_name")这样的动态变量的值?
在我的例子中,该类将有两个构造函数,它们都将3个字符串作为参数,但是在其中一个构造函数中初始化的字符串变量之一可能不同.是否可以实现以下内容:
class A {
String x = null;
String y = null;
String z = null;
String a = null;
A(String x, String y, String z) {
....
}
A(String a, String y, String z) {
....
}
}
Run Code Online (Sandbox Code Playgroud)