This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.foo; | |
import java.util.concurrent.locks.Condition; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantLock; | |
public class SomeClass { | |
public static void main(final String[] args) { | |
final Thread thread = new Thread(SomeClass::gameLoop); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String args[]) { | |
String str = "abc"; | |
byte[] cstr = str.getBytes(); | |
cstr[0] = 'b'; | |
System.out.println(new String(cstr)); | |
System.out.println(str); // still "abc" -> it has not changed | |
} |