My code:
public class Main {
public static void main(String[] args) {
OuterClass obj = new OuterClass();
}
}
There is a way that i can delet the Class object "obj" ?
My code:
public class Main {
public static void main(String[] args) {
OuterClass obj = new OuterClass();
}
}
There is a way that i can delet the Class object "obj" ?
delet, Disable the option to use obj again
You can do this.
public class Main {
public static void main(String[] args) {
{
OuterClass obj = new OuterClass();
}
// the field obj no longer exists.
String obj = "hi"; // this works as the previous `obj` doesn't apply here
}
}