This commit is contained in:
Steven Tracey 2023-03-20 15:59:19 -04:00
parent c884acd6e2
commit 05f4c98fbe
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package tech.nevets;
import java.io.File;
import java.io.IOException;
public class STFileWriter {
public static void main(String[] args) {
String user = "stracey.intern";
String fileLocation1 = "C:\\Users\\" + user + "\\Desktop\\back-slash.txt";
String fileLocation2 = "C:/Users/" + user + "/Desktop/forward-slash.txt";
File file1 = new File(fileLocation1);
File file2 = new File(fileLocation2);
try {
file1.createNewFile();
file2.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,18 @@
package tech.nevets;
public class STMethods {
public static void main(String[] args) {
System.out.println("Hello from the main method.");
displayMessage();
System.out.println("Back in the main method");
}
/**
* The {@link STMethods#displayMessage()} method displays a greeting.
*/
public static void displayMessage() {
System.out.println("Hello from the displayMessage method.");
}
}

View File

@ -0,0 +1,11 @@
package tech.nevets;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
public class STRandomizer {
public static void main(String[] args) {
Random rand = ThreadLocalRandom.current();
rand.nextInt();
}
}