Getting Started with Java Starting from 0 Part 1

Introduction

I joined an IT company from this spring. It was a start that I myself was touching C language at university. Meanwhile, it was difficult to understand what I thought after receiving programming training. In the end, I heard that the training was substantial, but I ended up covering everything by self-study. I started writing to new employees (new students?) Who are completely new to programming, hoping to be able to tell them that programming is like this.

environment

You need an environment to do programming. java is kind of annoying, and sometimes it doesn't work without jdk. There are various development environments and execution environments for programming itself, but if you want to start java for the time being, I think Dokojava is fine. You can find it by searching ** Dokojava **. If you are tired of typing passwords one by one, download eclipse. You can download it by searching for "pleiades" and (probably) going to the top site.

This time, I will write assuming Dokojava.

I will write

Let's actually write it. When you log in to dokojava,

Main.java


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

I think it says. Don't worry about public ~~ for the time being, and don't play with it **. System.out.println(""); Is called standard output, and it copies the characters enclosed in "" on the screen.

Please keep in mind that this is the grammar you will be using. Now, you can look at the above, so let's add another line of your choice.

Example


public class Main{
  public static void main(String[] args){
    System.out.println("Hello World");
    System.out.println("Hello Java");
  }
}

Try to run

Once you have added it, run it.

Dokojava people are easy and I think there is a word "compile" at the top of the screen, so click on it. You will be asked for a password (?), So enter it. ** (Please note that only half-width characters are recognized !!) ** It is OK if the text "No error" is displayed on the right side. If you have a message that you are not sure about, please check;, () and {} while looking at the above example. At first, there is no problem with a full copy.

Well, this is the end of compilation (like checking for errors). It's finally done. This is also easy for Dokojava people, and the word "Run" is on the right side of the compilation, so click it. You will also be asked for a password (?), So enter it. ** If you get "Run with details", click a little further to the left. ** **

To the bottom, Hello World Hello Java Is OK. ** Make sure that the "Hello Java" part contains the characters you typed. ** ** To run the resulting program, ** "compile" and "execute" **. Let's remember.

variable

The last is a variable. It's like x, y in mathematics, and you can enter values. That said, it's hard to understand, so rewrite the Dokojava code as follows.

Main.java


Public class Main{
  Public static void main(String[] args){
    String str = "Good Morning";
    System.out.println( str );
  }
}

After rewriting, let's "compile" and "execute". (If you don't understand, please proceed while looking at the above contents) As a result of executing, to the bottom Good Morning If it says, it's OK. Try replacing Good Morning yourself and seeing the output.

At the end

Well, how was it going so far? It's still going on, but for the time being, it's a break. I'm accepting input with the keyboard from now on, but there is a problem. ** ** To accept keyboard input with Dokojava, you must either ** register as a member of Dokojava or install a development tool called JDK .... ** If you've been following along so far, please ** install the JDK **. If you click on the gear in the upper right corner of Dokojava, there is an item called ** JDK Installation Guide **. If you follow the instructions there, you can install it. Of course, you can use Dokojava as it is.

If you still don't understand, please try it repeatedly. It's good to move on, but let's review this content once more.

Recommended Posts

Getting Started with Java Starting from 0 Part 1
Getting Started with Java Collection
Getting Started with Java Basics
Getting started with Java lambda expressions
Getting Started with Ruby for Java Engineers
AWS Lambda with Java starting now Part 1
Getting Started with DBUnit
Getting Started with Ruby
Getting Started with Swift
Getting Started with Docker
Getting Started with Doma-Transactions
Links & memos for getting started with Java (for myself)
Getting Started with Java 1 Putting together similar things
Getting started with Kotlin to send to Java developers
Getting Started with Doma-Annotation Processing
Getting started with Java programs using Visual Studio Code
Java starting from beginner, override
Java, instance starting from beginner
Getting Started with JSP & Servlet
Java starting from beginner, inheritance
Java life starting from scratch
Getting Started with Spring Boot
Getting Started with Legacy Java Engineers (Stream + Lambda Expression)
Getting Started with Ruby Modules
Getting started with Java and creating an AsciiDoc editor with JavaFX
Java to learn with ramen [Part 1]
Java, abstract classes starting from beginners
Code Java from Emacs with Eclim
[Google Cloud] Getting Started with Docker
Java overload constructor starting from beginner
Work with Google Sheets from Java
Server processing with Java (Introduction part.1)
Getting Started with Docker with VS Code
Spring Boot starting from zero Part 2
Spring Boot starting from zero Part 1
Returning to the beginning, getting started with Java ② Control statements, loop statements
Getting Started with Doma-Criteria API Cheat Sheet
Java starting from beginner, variables and types
Call GitHub API from Java Socket API part2
Java starting from beginner, nested / break / continue
Getting Started with Docker for Mac (Installation)
Java, if statement / switch statement starting from beginner
Getting Started with Parameterization Testing in JUnit
Java starting from beginners, logical operators / conditional operators
Getting Started with Ratpack (4)-Routing & Static Content
Getting started with the JVM's GC mechanism
Getting Started with Language Server Protocol with LSP4J
Java, for statement / while statement starting from beginner
Execute Java code from cpp with cocos2dx
Getting Started with Creating Resource Bundles with ListResoueceBundle
Java EE 8 (using NetBeans IDE 8.2) starting from sample code Part 1 Environment construction
Getting Started with Machine Learning with Spark "Price Estimate" # 1 Loading Datasets with Apache Spark (Java)
Getting Started with Java_Chapter 8_About Instances and Classes
Run Rust from Java with JNA (Java Native Access)
IntelliJ starting from 1
[Java] Set the time from the browser with jsoup
Getting Started with Doma-Using Projection with the Criteira API
JSON with Java and Jackson Part 2 XSS measures
java practice part 1
Getting Started with Doma-Using Subqueries with the Criteria API
Text extraction in Java from PDF with pdfbox-2.0.8