[JAVA] Notes in Android studio

Android studio -Edit text Click the text you want to edit and edit it from the items in attributes on the right side of the screen.

java -When dealing with values, etc., it is necessary to clarify the type of value and put it in the type.

Type name size Range of values
byte 1 byte -128 ~ 127
short 2 bytes -32768 ~ 32767
int 4 bytes -2147483648 ~ 2147483647
long 8 bytes -9223372036854775808 ~ 9223372036854775807

You don't have to actively use byte or short just because the value you put in is small. You can use int for ordinary integers and long for very large numbers. Furthermore, when dealing with decimal numbers, it is necessary to use a type that represents a floating point number.

Type name size
float 4 bytes
double 8 bytes

Both float and double can be used in the same way, but double can represent larger and finer numbers than float.

int x = 0.3; // This is an error double y = 0.3; // Using float and double like this Use boolean type to represent boolean value.

boolean flag = false; Use String type for strings. Note that S is a capital letter.

Also, when writing strings in source code, you must use "double quotation marks".

String message = "Hello";

·operator

operator
+ addition
- subtraction
* multiplication
/ division
% Remainder of division
&& Logical product (and)
II OR (or)
! Negation (not)
< Less than (less than)
> Greater (excess)
<= Less than
>= that's all
== equal
!= Not equal

Recommended Posts

Notes in Android studio
Automatically insert `@SuppressWarnings` in Android Studio
OkHttp3 (GET, POST) in Android Studio
Java to C and C to Java in Android Studio
How to use ExpandableListView in Android Studio
Riot (chat app) development (settings) in Android Studio
3 ways to import the library in Android Studio
Use the JDK used in Android Studio in the terminal
[Android / Kotlin] Detailed notes 2
Jigsaw notes in Gradle
Defeating Android Studio Part 3-6
Difficulties when implementing Alarm Manager in Android Studio
Defeating Android Studio Part 1 & Part 2
I got a cannot resolve symbol in Android Studio
Asynchronous processing and Web API integration in Android Studio
Java in Visual Studio Code
[Android] Implement Adblock in WebView
Refer to C ++ in the Android Studio module (Java / kotlin)
Use a JDK from another OpenJDK provider in Android Studio
You are currently using Java 6. Solution in Android Studio Gradle
Try implementing Android Hilt in Java
I tried to create a simple map app in Android Studio
[Android studio (version 4.0)] Until project creation
Android Studio data binding study summary
Notes for Android application development beginners
Notes on signal control in Java
Notes on calling Installer on Android App
Problems with android studio development series
Source to display character array with numberPicker in Android studio (Java)
Sort in List, for personal notes
Notes on Android (java) thread processing
Reintroducing Java 8 available from Android Studio 2.4
Organized notes in the head (Java-Exceptions)
Thymeleaf usage notes in Spring Boot
Android Studio JRE cannot be changed
Determining if a custom keyboard is enabled in Android Studio (Java)
I examined the file created when selecting Empty Activity in Android Studio
[Android Studio] Description that can be continuously input in SQLite Database [Java]
[Android] Gray out Menu Item in Options Menu
Android Studio x Wear Os by Google
Ruby on Rails in Visual Studio Codespaces
Notes on creating android plugins for Unity
Android Studio Shortcut Keys (Mac OS X 10.5+)
About UI thread processing in Android asynchronous
Face recognition app with OpenCV + Android Studio
Android Studio bulk comment out method memo
Screen transition by [Android Studio] [Java] button
Make Log of Android Studio / Xcode convenient
Notes on JSP extension tags in SpringFrameWork
[Mac] Install Java in Visual Studio Code
I have a question about Android studio.
Impressions and doubts about using java for the first time in Android Studio
Android Studio memo that you want to display Toast characters in large size
I stumbled on the Java version in Android Studio, so I will summarize it