Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 12, 2021 03:27 am GMT

Building My First Projects with Java!

Coming from the Flatiron Bootcamp, I have been exploring different programming languages out there to keep my wheels turning. Especially in this programming world where things are always changing and evolving, my passion for learning fuels my drive.

I have found myself enjoying Java and have decided to start building CLI projects. Alongside a Java course, I built 3 Projects this week: an email administration application, a student database application, and a bank account application. One thing is watching videos and reading articles but the best way to learn a new language, personally, is by building a project to see all the puzzle pieces come together!

In these projects, concatenating seemed to be my best friend. In Java, using the "+" provides a concatenation operator, you can directly add two String literals. A great example is when asking a user for input and printing it back out with some added text:

Scanner in = new Scanner(System.in);        System.out.print("Enter your name: ");        String name = in.nextLine(); //Input: Ken        System.out.print("Welcome, " + name + "!");//=> Welcome, Ken!

Something to remember when using the "+" operator, is that spacing is not included so it is best to include it before closing the double quotation mark.

A great escape character to use when displaying this data, and have it organized is 'newline' => "
". This also comes in handy when printing out multiple lines, it can show you what it will look like before it prints out.

// void means this method doesn't return a value public void showInfo(){      System.out.println(              "Name: " + name +              "
Age: " + age + "
Shoe Size: " + shoeSize );//=> Name: Ken// Age: 20// Shoe Size: 10

I am now working on implementing a CSV file reader for my banking project. Knowing there is always something you can improve or add to my project, or simply start a new one, is the reason I love what I do and why I can't picture myself doing anything else!


Original Link: https://dev.to/ken025/building-my-first-projects-with-java-1j2g

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To