我正在寻找一个解决方案,它将为我提供密码变量值通过的每个变量的名称。也就是说,{pass,temp,temp1,var1}
class Student{
public static void main(String args[]){
String password="GOPAL12345";
Student student=new Student();
String var1=student.passPassword(password);
System.out.println("Password is--> "+var1);
}
public String passPassword(String pass){
String temp=pass;
String temp1=temp;
return temp1;
}
}
我希望在运行时完成此操作。
答案 0 :(得分:1)
无法做到。变量名{pass,temp,temp1,var}在运行时不存在。