• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Local Variable

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following cannot be used in declaring and initializing an automatic (method local) variable?
A. Final
B. Public
C. Constants of non-primitive type
D. Inner class from other scopes
E. Initialized arrays(such as "{Hello", "Goodbye"})
I think the answer is B since the local variables LOCAL to the block of code. I am not very sure about option c. Can anyone explain?
Thanks in advance !!
Milind
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you to check this post which came up before.
I also suggest to everyone to use the search facility of this forum. There is a very good chance the qstn you have would have been discussed already.
regds
maha anna
 
Something must be done about this. Let's start by reading this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic