Skip to content

Instantly share code, notes, and snippets.

Avatar

Elijah eginter

  • Grey Matters Defense Solutions LLC
  • Denver, Colorado
View GitHub Profile
View gist:7bc188a8895ab8b1712266895d22b37b
Verifying my Blockstack ID is secured with the address 1AFJxSnwCFVMruvWkSTxy1NqjzJLegNJH4 https://explorer.blockstack.org/address/1AFJxSnwCFVMruvWkSTxy1NqjzJLegNJH4
View gist:4517867ad0b1f5444f5f88702cc727d6
String s1 = "aaa";
String s2 = "aaa";
if(s1 == s2)
System.out.println("s1 == s2 is TRUE");
else
System.out.println("s1 == s2 is FALSE");
Output:
s1 == s2 is FALSE
View gist:612afa15346b8d8a2da001be4f457660
String s1 = "aaa";
String s2 = "aaa";
if(s1.equals(s2))
System.out.println("s1 == s2 is TRUE");
else
System.out.println("s1 == s2 is FALSE");
Output:
s1 == s2 is TRUE
View gist:a128d8560d08f40d99848a8beb4038f7
String s1 = "aaa";
String s2 = s1;
if(s1 == s2)
System.out.println("s1 == s2 is TRUE");
else
System.out.println("s1 == s2 is FALSE");
Output:
s1 == s2 is TRUE
View gist:0f63494e6c088de0812001b6c9baff32
int a; // This is a declaration without initialization
double n = 2.25; // A declaration and initialization (first assignment)
n = 8.3; // An assignment to a new value
View gist:bd61b06830d4656e8efe52b25920da49
import java.util.Scanner;
public class KeepGuessing {
public static void main( String[] args ) {
Scanner keyboard = new Scanner(System.in);
int secret, guess;
secret = 1 + (int)(Math.random()*10);
System.out.println( "I have chosen a number between 1 and 10." );