The Artima Developer Community
Sponsored Link

Java Buzz Forum
Friday Java Quiz: Shadowing A Variable Name

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Friday Java Quiz: Shadowing A Variable Name Posted: May 1, 2009 7:58 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Friday Java Quiz: Shadowing A Variable Name
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

I haven't posted a quiz for 34 days. It's time to have one.

Q: Will the following PL/SQL code compile and run without exceptions under the Oracle JDK? If so, what will it print?

 
1    public class Foo { 
2        public static void main(String[] args) { 
3            int x = 1024; 
4            { 
5                int x = 2048; 
6                System.out.println("In inner block, x = " + x); 
7            } 
8            System.out.println("In outer scope, x = " + x); 
9        } 
10   }

Read: Friday Java Quiz: Shadowing A Variable Name

Topic: Google has released the Android 1.5, Cupcake, Software Development Kit. Previous Topic   Next Topic Topic: Mastering Spring MVC

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use