Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
question
Soum Sark
Ranch Hand
Posts: 50
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Why does
System.out.print("1")
compile when in a {} and not when outside. What purpose does the {} serve ?
class Q {
{
System.out.print("1");
}
static {
System.out.print("2");
}
Q() {
System.out.print("3");
}
}
Valentin Crettaz
Author & Gold Digger
Posts: 7617
6
I like...
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
{} denotes an instance initialization block. Please refer to
JLS 8.6 Instance Initializers
for detailed information.
My Linked In
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
truth table
Dan's GC question
Thread questions
runtime vs compiler error
Dan's mock question
More...