Day 1: Java with Multiple Strings, Formatters, and Conditionals

What I learned…errr last night was about using multiple strings with formatters in Java. For instance:

This is sort of like when I was doing Learn Python the Hard Way only the syntax is different and more verbose.

I learned how to get information into the console by way of prompting the user. So you have the console object and the method readLine to say something like:

This was interesting, getting to learn these new methods for a new language. Also knowing the Java is compiled and how to run the compile command with:

I learned more about integers and getting an integer from a string. Whereas in JavaScript you’d use:

in Java you have this long string:

Building things and adding conditions was interesting as well. Here is a little snippet of the app we built in Java:

To be honest, Java isn’t really too bad. I don’t like the verbosity. For instance in JavaScript you can call a method:

instead of what we’ve got here in Java. Java is a little better in that the .equalsIgnoreCase makes things simpler so I could call it on any object and the case would be ignored completely. But it just looks cleaner.

So that was my experience fo Java Beginner Basic Course on Treehouse. I plan on diving deeper as the semester grinds on. For now, it’s learning RegEx and then back to JavaScript as I want to start thinking about building my app.

© tiff.RSS