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 class Test { | |
public static void main(String... args) { | |
String x = "abc"; | |
String y = "def"; | |
String xy = x + y; | |
xy.intern(); | |
// With this line here, the output is true | |
// which shows that the literal here is only taken |
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 class Test { | |
public static void main(String... args) { | |
String x = new String(new char[] {'a', 'b', 'c'}); | |
String y = new String(new char[] {'d', 'e', 'f'}); | |
String xy = x + y; | |
xy.intern(); | |
// With this line here, the output is true | |
// which shows that the literal here is only taken |
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 class Test { | |
public static void main(String[] args) { | |
int n = 1; // Less than 2 | |
int x = 1; | |
int y = 2; | |
while (y < n) { | |
// This is never reached | |
System.out.println("In while loop"); | |
if (n % y == 0) { | |
n = n / y; |
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
using System; | |
class Message | |
{ | |
public string Body { get; set; } | |
public Message GetNewMessage() | |
{ | |
return new Message | |
{ |
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
using System; | |
using System.Text.RegularExpressions; | |
class Test | |
{ | |
static void Main() | |
{ | |
string before = @":[email protected] private #timing :\u000314CODEERROR:\u0003 [\u000304X012\u0003] Server time is different than UTC"; | |
string after = Regex.Replace(before, @"\\u0{3}3\d{0,2}", string.Empty); | |
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
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
string text = "0|aaaaaa|aaaaaaaaaaa|aaaaaaaaaa|123456|0|0"; | |
string[] parts = text.Split(new char[] { '|' }); | |
for (int i = 0; i < parts.Length; i++) |
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
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
string text = "0|aaaaaa|aaaaaaaaaaa|aaaaaaaaaa|123456|0|0"; | |
string[] parts = text.Split(new char[] { '|' }); | |
for (int i = 0; i < parts.Length; i++) |
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
using System; | |
using System.Text.RegularExpressions; | |
class Test | |
{ | |
static void Main() | |
{ | |
string text = @"A Foobar is cool stuff, as we can see in Figure 1.1: | |
Figure 1.1 This is a Foobar"; |
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
using System; | |
using System.Threading; | |
class Program | |
{ | |
static int value; | |
static void Main(string[] args) | |
{ | |
new Thread(ChangeValueRepeatedly).Start(); |
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
using System; | |
using System.Collections.Generic; | |
using System.Web.Script.Serialization; | |
namespace TestApp | |
{ | |
class Program | |
{ | |
static void Main() | |
{ |