Skip to content

Instantly share code, notes, and snippets.

@xennygrimmato
Created August 1, 2016 18:28
Show Gist options
  • Save xennygrimmato/260d50a78be0a21f0c5552d6b80a4ec2 to your computer and use it in GitHub Desktop.
Save xennygrimmato/260d50a78be0a21f0c5552d6b80a4ec2 to your computer and use it in GitHub Desktop.
Java code that gives Null Pointer Exception
import java.io.*;
import java.util.*;
public class Hello {
private static String x=null, y=null;
public static void main(String[] args) {
if(x.concat(y) == "abcd") {
System.out.println("Matched");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment