Java to learn with ramen [Part 1]

Learn Java with Ramen

Because everyone likes ramen. Learn the basics of Java through ramen.

A series of goals

--Become able to understand and write the basics of Java

I hope readers have reached this level.

Challenge the output

In programming learning, the introduction that corresponds to "This is a pen." Is to output "Hello World!". However, everyone who loves ramen will be asked to output "I love ramen".

The keyword when you want to output in Java is System.out.println(); is. The contents put in this () are output.

If you want to output "I love ramen", do this.

Main.java


public class Main {
    public static void main(String[] args) {
        System.out.println("I love ramen");
    }
}

now, public class Main public static void main(String[] args) I don't care about that ** System.out.println (); ** "I love ramen" in () Make sure that is included.

If you execute it in this state, it will be displayed on the console. I think that "I love ramen" will be output.

Just in case, please be careful

-"", (), {} must be half-width.

is. If you keep this, it should work.

Now, what if you want to eat ramen? It's okay if you replace "I love ramen" with "I want to eat ramen".

Main.java


public class Main {
    public static void main(String[] args) {
        System.out.println("I want to eat ramen");
    }
}

I think you can tell that you want to eat ramen.

About variables

Let's write the "I love ramen" sentence written above a little smarter. Use variables to write smartly.

Variables are often likened to boxes. By putting letters and numbers in a box, people who see the box can check and use the values in it.

However, since it is "Java learned from ramen", I will explain about ramen.

When we eat ramen at the store, the ramen is in a bowl. There should be no store that hands you noodles and soup. Please think here that the "variable" corresponds to this "vessel".

The ramen made by the shopkeeper is put in a bowl and provided to us, and we receive the ramen inside the bowl.

The same is true for Java (and many programming languages), where someone puts the result of a calculation into a "variable" and we use the contents of that variable to do more calculations or output the contents.

Now, let's write a "I love ramen" sentence using variables.

Main.java


public class Main {
    public static void main(String[] args) {

        String love = "I love ramen";

        System.out.println(love);
    }
}

Here, I put your ramen love in a variable called "love". System.out.println(love); Is outputting the contents of your love.

"Wait a minute, what is" String "?" Please wait for the next time.

Recommended Posts

Java to learn with ramen [Part 1]
Java to play with Function
Connect to DB with Java
Connect to MySQL 8 with Java
[Java] Points to note with Arrays.asList ()
Learn about transaction savepoints (with Java)
Dare to challenge Kaggle with Java (1)
How to learn JAVA in 7 days
I tried to interact with Java
Does Java Need to Learn Anymore?
Server processing with Java (Introduction part.1)
Java, arrays to start with beginners
Reintroduction to Operators with RxJava Part 1
Connecting to a database with Java (Part 1) Maybe the basic method
Introduction to Java that can be understood even with Krillin (Part 1)
Kotlin Class part.2 to send to Java developers
How to compile Java with VsCode & Ant
[Java] How to compare with equals method
Learn Java with "So What" [For beginners]
Introduction to algorithms with java --Search (depth-first search)
Getting Started with Java Starting from 0 Part 1
AWS Lambda with Java starting now Part 1
Easy to trip with Java regular expressions
[Java] Learn how to use Optional correctly
Introduction to algorithms with java --Search (breadth-first search)
[Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 2
[Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 1
[Code Pipeline x Elastic Beanstalk] CI / CD Java application to Elastic Beanstalk with Code Pipeline Part 3
java practice part 1
[Java] Introduction to Java
Introduction to java
Challenge to deal with garbled characters with Java AudioSystem.getMixerInfo ()
[Java] How to test for null with JUnit
I tried to make Basic authentication with Java
Introduction to algorithms with java --Search (bit full search)
Deploy Java web app to Azure with maven
Try to link Ruby and Java with Dapr
Road to Java Engineer Part1 Introduction & Environment Construction
How to use Java framework with AWS Lambda! ??
JSON with Java and Jackson Part 2 XSS measures
I want to use java8 forEach with index
How to use Java API with lambda expression
Getting started with Kotlin to send to Java developers
Try to implement TCP / IP + NIO with JAVA
[Java] Article to add validation with Spring Boot 2.3.1.
Easy to make LINE BOT with Java Servlet
I tried to break a block with java (1)
Java engineers now compare to learn the basic grammar of Ruby Part 1 (Basic, Variables)
Java engineers now compare to learn the basic grammar of Ruby Part 2 (classes, methods)
How to call functions in bulk with Java reflection
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 3
List processing to understand with pictures --java8 stream / javaslang-
[Java] Find prime numbers with an Eratosthenes sieve (Part 2)
Changes from Java 8 to Java 11
Sum from Java_1 to 100
SaveAsBinaryFile with Spark (Part 2)
I tried to implement TCP / IP + BIO with JAVA
Change seats with java
Install Java with Ansible
[Java 11] I tried to execute Java without compiling with javac
[Java] How to omit spring constructor injection with Lombok