aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String array's weird syntax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "String array Watch "String array New topic
Author

String array's weird syntax

rohan yadav
Ranch Hand

Joined: Oct 13, 2009
Posts: 156


Can anyone explain me how this syntax is allowed.


Sage of The Monstrous Toad of Mount Myoboku
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

If you display the length of it you will know how:



SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
rohan yadav
Ranch Hand

Joined: Oct 13, 2009
Posts: 156
Its displaying ASCII value of char 'a'.
But still i am not clear???
Chinna Eranna
Ranch Hand

Joined: Dec 08, 2009
Posts: 174

>> Its displaying ASCII value of char 'a'.

Exactly.. the statement is trying to define a String array of size, whose value equals to ASCII 'a'


- Chinna
rohan yadav
Ranch Hand

Joined: Oct 13, 2009
Posts: 156
Thanks Chinna Eranna and Chinna Eranna, Understood now
Neha Daga
Ranch Hand

Joined: Oct 30, 2009
Posts: 504
but it doesn't compile on my pc.


SCJP 1.6 96%
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

Neha: What version of Java are you using and what error message do you get?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Neha Daga
Ranch Hand

Joined: Oct 30, 2009
Posts: 504
oh sorry, i mistyped it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String array's weird syntax
 
Similar Threads
var args doubt
Java SE 6 validating Required data elements
main method signature..
Right combination of single/double quotes
Difference between String s = "Marcus"; vs String s2 = new String("Marcus");