Last active
May 2, 2016 00:48
-
-
Save dante-byte/c90accc314a274facfd33df798ec687f to your computer and use it in GitHub Desktop.
This file contains 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
package tiy; | |
/** | |
* Created by Donta White on 4/30/2016. | |
*/ | |
import java.util.Scanner; | |
public class JavaConvention { | |
public static void main(String[] args){ | |
System.out.println("please enter a string"); | |
Scanner lineScanner = new Scanner(System.in); | |
String myInput = lineScanner.nextLine(); | |
for (int counter = 0; counter < 100; counter++) { | |
System.out.println("choose how you would like to see your string, below are your options "); | |
System.out.println("variable"); | |
System.out.println("method"); | |
System.out.println("class"); | |
String newInput = lineScanner.nextLine(); | |
if (newInput.equals("variable")) { | |
System.out.println("myStateIndicator as a variable" + ">" + " " + myInput); | |
} | |
if (newInput.equals("method")) { | |
System.out.println("myStateIndicator() as a method " + ">" + " " + myInput); | |
} | |
if (newInput.equals("class")) { | |
System.out.println("MyStateIndicator {} as a class" + ">" + " " + myInput); | |
} | |
} | |
} | |
public static void substring(){ | |
System.out.println("testing the substring method below"); | |
String example1 = "This is a test"; | |
example1.substring(2); | |
System.out.println(example1); | |
} | |
public static void split(){ | |
System.out.println(" just testing two "); | |
} | |
public static void toUpperCase(){ | |
String Abc = new String("This is a test"); | |
System.out.println(Abc.toUpperCase()); | |
} | |
public static void toLowerCase(){ | |
String Abc = new String("This is a test"); | |
System.out.println(Abc.toLowerCase()); | |
} | |
public static void length(){ | |
String abc = new String("This is o a test"); | |
System.out.println(abc.length()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment