DEV Community 👩‍💻👨‍💻

aelexa
aelexa

Posted on

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

Top comments (2)

Collapse
 
aelexa profile image
aelexa • Edited on

if anyone were offended in my grammar im very sorry english is not my first language
im open for any corrections in my code!

tnx

We want your help! Become a Tag Moderator.
Fill out this survey and help us moderate our community by becoming a tag moderator here at DEV.