Java programming (variables and data)

Programming and variables

This article introduces variables. Variables are inevitable in programming. After all, programming involves manipulating variables and exchanging information about what happens.

Variable type

In Java, variables are defined as types. There are various types such as "this is a character string type", "integer type", and "real number type". When listing

Mold contents
String String
int integer
double Real number
boolean True or false

There are others, but you should know this much.

Use of variables

Variables are not something you can use in Java. Before using it, you must declare that you will use this character in a variable of this type.

double a;
int b = 2;
String c;
boolean d;

By doing this, for example, a variable

a = 0.5;
a = a + 1.2; 

You can operate with. At this point the variable a is 1.7. You can also decide the value of the variable when you declare it, or you can enter the value later.

By the way, it is null when there is nothing in the variable.

About future articles

In the future, I will explain about Java. I don't think you can understand anything in the current state. However, I have introduced variables just in case. Next article About the class (please wait)

Recommended Posts

Java programming (variables and data)
Java programming (static clauses and "class variables")
[Java] Variables and types
[Processing x Java] Data type and object-oriented programming
[Programming Complete] §4 Variables and constants
Java Primer Series (Variables and Types)
Basic data types and reference types (Java)
Java basic data types and reference types
[Java] output, variables
Java starting from beginner, variables and types
[Introduction to Java] Variables and types (variable declaration, initialization, data type)
java programming basics
[Java] Differences between instance variables and class variables
Java programming (classes and instances, main methods)
[WIP] Java variables
java Generic Programming
Java and JavaScript
XXE and Java
About Java data types (especially primitive types) and literals
Java and Swift comparison (1) Source control / Scope / Variables
Constraint programming in Java
Getters and setters (Java)
[Java] Thread and Runnable
Java true and false
[Java] String comparison and && and ||
[Java] Data type ①-Basic type
Java programming basics practice-array
Java programming (class method)
Java --Serialization and Deserialization
[Java] Arguments and parameters
[Swift] Constants and variables
Ruby variables and methods
timedatectl and Java TimeZone
[Java] Branch and repeat
[Java] Main data types
Java programming (class structure)
All about Java programming
java competitive programming memo
java (classes and instances)
Java basic data types
[Java] Overload and override
Java Programming Thread Runnable
Java variable declaration, initialization, data type (cast and promotion)
Vectorize and image MNIST handwritten digit image data in Java
[Java] Difference between static final and final in member variables
[Java] Refer to and set private variables with reflection
Java review ① (development steps, basic grammar, variables, data types)
About Java basic data types and reference type memory
[Java Silver] What are class variables instance variables and local variables?
Study Java # 2 (\ mark and operator)
[Java Bronze learning] Differences between encapsulation, data hiding, and information hiding
[Java] Make variables in extended for statement and for Each statement immutable
Java learning memo (data type)
Basic data type and reference type
Window aggregation of sensor data with Apache Flink and Java 8
[Java] Difference between == and equals
Amazing Java programming (let's stop)
[Java] Stack area and static area
(Note) Java classes / variables / methods
[Java] Generics classes and generics methods
Java encryption and decryption PDF