Results 1 to 3 of 3
Thread: Final variables in method
- 03-04-2012, 03:29 PM #1
Final variables in method
I have another doubt..
1.can we declare final variables in a class outside a method
example: public class A { final xxx xxxx; --methods{}//end of methods-- }//end of class
2.can we declare static variables in a class outside a method
3.can we declare public variables in a class outside a method
- 03-04-2012, 03:32 PM #2
Re: Final variables in method
What does the compiler say when you try those things?
Code a small test program and try them.
- 03-04-2012, 03:32 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Final variables shouldn't also be static?
By emilioJazz in forum Advanced JavaReplies: 5Last Post: 11-29-2010, 11:10 AM -
Final variable-constructor method.
By D4rkNrG in forum New To JavaReplies: 9Last Post: 10-13-2010, 11:18 AM -
final variables in abstract classes
By parulmahajan in forum New To JavaReplies: 4Last Post: 06-11-2010, 09:54 AM -
Using final with method arguments
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:48 PM -
Method with final keyword
By javaplus in forum New To JavaReplies: 2Last Post: 11-29-2007, 09:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks