Sun Blogs – Understanding Inception using try-with-resources

by InceptionEnding

in Inception Ending

“After viewing the film “Inception,” I was inspired to use the new try-with-resources statement to summarize the film:

    public static void main(String... args) {
        try(CloseableDreamLevel dl1 =
            kickOnClose(createCityScape(firstClassCabin)) ) {
            try(CloseableDreamLevel dl2 =
                 kickOnClose(createHotel(dl1))) {
                 try(CloseableDreamLevel dl3 =
                     kickOnClose(createSnowMountainFortress(dl2))) {
                     inception();
                     try(CloseableDreamLevel dl4 =
                         kickOnClose(enterLimbo(dl3))) {
                         findTheLost();
                     }
                 }
            }
        }
    }
    private static DreamLevel enterLimbo(DreamLevel dl) {
        return
            new DreamLevel() {
                void kick() {
                    try {
                    if ((new java.util.Random()).nextBoolean())
                    Thread.currentThread().sleep(Integer.MAX_VALUE);
                    } catch (InterruptedException ie) {}
                }
            };
    }

http://blogs.sun.com/darcy/entry/understanding_inception_using_try_with

Related posts:

  1. WeGotThisCovered – Dream A Little Bigger: A Guide To Understanding Inception “…12. So what happened at the end? The ending is the most confusing part of the film. There are a couple of theories as to what happened. The theories are as follows: 12a) Nothing Ever Happened The nothing ever happened ending is the simplest. Some people believe that nothing ever...
  2. Chicago Sun-Times – What the heck is ‘Inception’ about anyway? “1. The most straightforward interpretation: Saito hires Cobb and his team to plant an idea in Fischer’s mind. They succeed, and Cobb is rewarded with a trip home, where he is finally reunited with his children. He will never see his wife in his dreams again. The last scene is...

Leave a Comment

Previous post:

Next post: