DEV Community

Cover image for Learning a New Language - Java!
Kenneth M. Colón Pagán
Kenneth M. Colón Pagán

Posted on

2 2

Learning a New Language - Java!

Last week, I wrote about my job hunt process and what I have been doing during so. In this industry where one can never learn enough and know everything, it is important to familiarize yourself with the different patterns and styles of the many languages that exist. This has taught me how similar patterns can be and it all lies in the syntax.

This week I will walk through some of the parts I found most interesting while learning the basics of Java. A factor I always look for is the data types and their size to make sure my application is as efficient as it can be. For Java, I look to this Primitive Types diagram to use as a guide:

Alt Text

Another difference I have noticed across languages is in the CLI. In Java, we use the Scanner class which is used to get user input, and it is found in the java.util package.

Example:
To ask the users their age and return "You are __" with their input age.

 Scanner scanner = new Scanner(System.in);
        System.out.print("Enter your age: ");
        byte yourAge = scanner.nextByte();
        System.out.println("You are " + yourAge);
Enter fullscreen mode Exit fullscreen mode

In general, these are notes that anyone starting to learn Java can use or come back to for a refresher on data types and user inputs.

Here is a link to the Java Tutorial for Beginners I used to get started!

Jetbrains image

Don’t Become a Data Breach Headline

57% of organizations have suffered from a security incident related to DevOps toolchain exposures. Is your CI/CD protected? Check out these nine practical tips to keep your CI/CD secure—without adding friction.

Learn more

Top comments (0)

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay