Skip to content

Instantly share code, notes, and snippets.

View eginter's full-sized avatar

Elijah eginter

  • Grand Island, NY
View GitHub Profile
Verifying my Blockstack ID is secured with the address 1AFJxSnwCFVMruvWkSTxy1NqjzJLegNJH4 https://explorer.blockstack.org/address/1AFJxSnwCFVMruvWkSTxy1NqjzJLegNJH4
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
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
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
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
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." );