Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
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:
Beginning Java
length method not with braces
shivam aggarwal
Greenhorn
Posts: 8
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
why is 'length' method not used with usual braces,unlike other methods?
Rob Spoor
Sheriff
Posts: 22783
131
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you are talking about the .length attribute of arrays, the answer is pretty simple - it's not a method. You might say it's something like a public final int field - you can read it but not change it.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
samir singha
Greenhorn
Posts: 23
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you use
String
in your code you will find length() method with braces.
Campbell Ritchie
Marshal
Posts: 79179
377
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Braces look like this: {}
What you showed
()
are called parentheses (in America) or sometimes (round) brackets (in Britain), never braces.
samir singha
Greenhorn
Posts: 23
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You are right ritchie. Though I knew the differance, I have done the mistake unknowingly.
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
Reg ; after a method
illegal start of expression
String.format() problem
classes and applications
Java noob needs help
More...