Java learning 2 (learning calculation method)

Purpose of the article

Since I decided to use Java in my business,
to output basic Java usage and organize my knowledge.

MyApp.java


public class MyApp{
  public static void main(String[] args){
   //Calculation
   int i;
   i = 10 / 3;
   System.out.println(i); 
   i = 10 % 3;
   System.out.println(i); 
   int x = 5;
   x++;
   System.out.println(x); 
   x--;
   System.out.println(x); 
  }
}
$ javac MyApp.java
$ java MyApp
3
1
6
5

MyApp.java


public class MyApp{
  public static void main(String[] args){
    //Calculation
    int x = 5;
    //x = x + 12;
    x += 12;
    System.out.println(x);
    
    String s;
    s = "hello" + "world!";
    System.out.println(s);
  }
}
$ javac MyApp.java
$ java MyApp
17
helloworld!

Recommended Posts

Java learning 2 (learning calculation method)
Java learning memo (method)
Java learning (0)
Java method
java (method)
Java method
[Java] method
[Java] method
For JAVA learning (2018-03-16-01)
Java learning day 5
Java8 method reference
[Java] forEach method
java8 method reference
[Java] Random method
[Java] split method
java learning day 2
java learning day 1
Java Silver exam procedure and learning method
JAVA DB connection method
java learning (conditional expression)
Java Learning (1)-Hello World
About Java method binding
About method splitting (Java)
Studying Java 8 (see method)
JAVA learning history interface
Java programming (class method)
Java learning memo (basic)
[Qualification Exam] Java SE 8 Silver Learning Method Summary
Java learning memo (interface)
Java learning memo (inheritance)
[Java] Basic method notes
Learning Java framework # 1 (Mac version)
Java basic learning content 7 (exception)
[Java] New Thread generation method (2)
JAVA learning history interface inheritance
Java GC method determination conditions
Java basic learning content 5 (modifier)
Books used for learning Java
4th day of java learning
Java Silver Study Method Memo
Create a java method [Memo] [java11]
Java test code method collection
[Java Silver] About equals method
Combination calculation (Pascal's triangle) (Java)
Java learning memo (logical operator)
[Java] Timer processing implementation method
Java learning memo (abstract class)
[Java] Random number generation method (Random)
Java methods and method overloads
Benefits of Java static method
[Java Silver] Array generation method
Java Basic Learning Content 8 (Java API)
Java Learning 1 (learning various data types)
[Java] New Thread generation method (1)
Java basic learning content 4 (repetition)
Deep Learning Java from scratch Chapter 5 Error back propagation method
[Java Bronze] Learning memo (interface, static method, type conversion, etc.)
[Java] Object-oriented syntax --class method / argument
Java learning memo (creating an array)
Deep Learning Java from scratch 6.4 Regularization
Automatic photo resizing method in Java