new year, fresh start…
“Welcome to the new year and a fresh start! As we begin another year, it’s time for new adventures and opportunities to learn and grow.
I wanted to invite you to follow me on my journey as I work towards obtaining my computer science degree while also being a single parent and recently laid off. My goal is to share my experiences and knowledge with my readers as I learn and grow.
So far, I have started learning Java programming, which is quite different from Python. We’re only in the first week, but I’m already learning about fundamental concepts such as data types, syntax, and classes. One thing that I’ve found useful so far is the Scanner method.
In Java, the Scanner class is a simple text scanner that can parse primitive types and strings using regular expressions. You can use the Scanner class to read input from the user in the command line.
Here’s an example of how to use the Scanner class to read a string from the user:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter an integer: ");
int input = scanner.nextInt();
System.out.println("You entered: " + input);
}
}
This code will prompt the user to enter an integer, and then it will print out the integer that the user entered.
Subscribe & Follow for more updates on my journey.