[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 10 KB, 300x300, java[1].jpg [View same] [iqdb] [saucenao] [google]
1042871 No.1042871 [Reply] [Original]

ok, i'm new to java, and i can't figure out if i'm retarded or if is there no length/size method for arrays, at least for string arrays

how do i get the size of the array?

>> No.1042884

/g/ might know better if you get no replies here

>> No.1042904

>>1042884

NO, /g/ is trolls trolling trolls

anyways
http://thepiratebay.org/torrent/5180353/Beginning.Programming.With.Java.For.Dummies.2nd.Edition

You'll find everything you need there.

>> No.1042907

>>1042871
Do you want the length of a string, or the length of an array of strings?

>> No.1042913

String a = "astring";
int length;

length = a.length()

>> No.1042924

>>1042907

the length of an array of strings

and there also seems to be almost no methods for arrays, what's that all about?

>> No.1042926
File: 29 KB, 367x451, ahhahahafaggot.jpg [View same] [iqdb] [saucenao] [google]
1042926

I have a whole roll of string, I can make whatever length string I want!

>> No.1042963

>>1042924
http://java.sun.com/javase/6/docs/api/java/lang/reflect/Array.html#getLength%28java.lang.Object%29

>> No.1042993

>>1042963
If you can't understand the documentation, then here:

String[] s = {"abc", "fgs"};

Array.getLength(s);

>> No.1043026

>>1042904
>NO, /g/ is trolls trolling trolls
And /sci/ is what?
Are you trying to imply /sci/ is less stupid than /g/? How can you beleive it if it's just a theory (a geuss)?