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…


This content originally appeared on DEV Community and was authored by Kenneth M. Colón Pagán

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' => "\n". 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 +
              "\nAge: " + age +
              "\nShoe 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!


This content originally appeared on DEV Community and was authored by Kenneth M. Colón Pagán


Print Share Comment Cite Upload Translate Updates
APA

Kenneth M. Colón Pagán | Sciencx (2021-03-12T03:27:15+00:00) Building My First Projects with Java!. Retrieved from https://www.scien.cx/2021/03/12/building-my-first-projects-with-java/

MLA
" » Building My First Projects with Java!." Kenneth M. Colón Pagán | Sciencx - Friday March 12, 2021, https://www.scien.cx/2021/03/12/building-my-first-projects-with-java/
HARVARD
Kenneth M. Colón Pagán | Sciencx Friday March 12, 2021 » Building My First Projects with Java!., viewed ,<https://www.scien.cx/2021/03/12/building-my-first-projects-with-java/>
VANCOUVER
Kenneth M. Colón Pagán | Sciencx - » Building My First Projects with Java!. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/12/building-my-first-projects-with-java/
CHICAGO
" » Building My First Projects with Java!." Kenneth M. Colón Pagán | Sciencx - Accessed . https://www.scien.cx/2021/03/12/building-my-first-projects-with-java/
IEEE
" » Building My First Projects with Java!." Kenneth M. Colón Pagán | Sciencx [Online]. Available: https://www.scien.cx/2021/03/12/building-my-first-projects-with-java/. [Accessed: ]
rf:citation
» Building My First Projects with Java! | Kenneth M. Colón Pagán | Sciencx | https://www.scien.cx/2021/03/12/building-my-first-projects-with-java/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.