Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- static class blah{
- public String password;
- blah() throws Exception{
- password = "secret_password";
- throw new Exception();
- }
- }
- static class Glah extends blah{
- public Glah() throws Exception{
- super();
- }
- @Override
- public void finalize(){
- System.out.println(password);
- }
- }
- public static void main(String args[]) {
- try{
- Glah glah = new Glah();
- }
- catch(Exception ex){
- ex.printStackTrace();
- }
- System.out.println("Im here");
- System.gc(); //prints the password.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement