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 SpecialCharacters { | |
public static void main(String[] args) { | |
String message1, message2; | |
message1 ="message1 = \\/\\/\\/\\/\\/\\r\\t\\b "; | |
message2 = "\nmessage2 = \";"; | |
System.out.println(message1 + message2); | |
} | |
} |
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 StringAssignment { | |
public static void main(String[] args) { | |
String name = "Alton"; | |
System.out.print(name); | |
} | |
} |
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
import java.util.Scanner; | |
public class PetQuestions { | |
public static void main(String[] args) { | |
String name; | |
String breed; | |
int age; | |
Scanner keyboard = new Scanner(System.in); |
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 ChangeProgram { | |
public static void main(String[] args) { | |
int x; | |
double y, z; | |
x = 5; | |
y = 8.75; | |
z = x * 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
public class MathTwoProg { | |
public static void main(String[] args) { | |
int myNumber; | |
double myOtherNumber; | |
myNumber = 2; | |
myOtherNumber = 1.7938; | |
System.out.println("myNumber is " + myNumber); | |
System.out.println("myOtherNumber is " + myOtherNumber); |
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 DebugProg { | |
public static void main(String[] args) { | |
double x, y; | |
x = 3.1415; | |
y = 3.64; | |
System.out.println("pi is approximately " + x); | |
System.out.println("My GPA was " + 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
public class MyProgram | |
{ | |
public static void main( String[] args ) | |
{ | |
// My name is Alton | |
// I am 47 years old | |
} | |
} |
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 PrintReceipt | |
{ | |
public static void main( String[] args ) | |
{ | |
System.out.println( "+--------------------------------------+"); | |
System.out.println( "| Evil Bank ATM Receipt |"); | |
System.out.println( "| Wednesday, December 2, 2015 |"); | |
System.out.println( "| ATM Location # 666 |"); | |
System.out.println( "| |"); | |
System.out.println( "| |"); |
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 HelloWorld | |
{ | |
public static void main( String[] args ) | |
{ | |
System.out.println( "Hello, World!" ); | |
System.out.println("Today is July 19, 2015. I am alive!"); | |
System.out.println("My name is Alton."); | |
} | |
} |