Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java

Name: Anonymous 2009-01-19 10:00

right /prog/ i've never used a text board on here, so, here goes. I would like a small hand with some basic java programming. I am using the BlueJ environment.

Given two Strings s1 and s2 already defined as

String s1 = "SESQUIPEDALIANISM";
String s2 = "";

write a sequence of lines of java code that will make String s2 contain (only)
the letters number 3, 10 and 12 from s1
(e.g. if s1 was "piano"
s2 containing letters 1, 3 and 4 would make s2 = "pan").

Name: Anonymous 2009-01-19 20:57

>>19
I lol'd

I don't know a while lot about Java, but, if the string is allocated on stack, then each thread has its own stack, so there's no need to global object to access, so no need to synchronize, if it's done via heap, then it's still a local variable to your function, so you wouldn't need to lock it, as no other code can access it(not even your function when running twice). You would only need to do this if you were editing a member of some class, and then, but then, you'd need to take extra precautions, which are not included in your code.

Have I been trolled?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List