Java Practice on Holidays

aelexa

aelexa

Posted on December 14, 2021

Java Practice on Holidays

Today,i finally decided to be productive atleast and practice on java basics

i think this is the start of my java journey? or roadmap.

Right now im following Programiz Java Excercises

java-programming/examples

i do these exercise by not looking at the actual code thats not a flex cause i need more practice writing good variable name

01

Java Program to Print an Integer (Entered by the User)


`import java.util.Scanner;
public class RandomPractice {
    public static void main(String[] args) {        

     Scanner scan = new Scanner(System.in);

  System.out.println("Enter a number : ");
  int number = scan.nextInt();

// Concatenates String and Number entered by user 
// Prints the number you entered 
// These " " are used to separate variables in one line 
  System.out.println("You entered" + " " +number);`

INPUT  : 10 
OUTPUT : You entered 10

Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
aelexa
aelexa

Posted on December 14, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related