일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
- Design Patterns
- JPA
- jsp
- redis
- php
- Oracle
- java
- 맛집
- IntelliJ
- AWS
- db
- springboot
- devops
- Gradle
- it
- 요리
- laravel
- elasticsearch
- linux
- Spring
- javascript
- ReactJS
- ubuntu
- Git
- Spring Boot
- tool
- MySQL
- jenkins
- Web Server
- docker
- Today
- Total
목록2019/06/13 (2)
아무거나
1. 나눗셈 package org.opentutorials.javatutorials.operator; public class RemainerDemo { public static void main(String[] args) { int a = 3; System.out.println(0%a); System.out.println(1%a); System.out.println(2%a); System.out.println(3%a); System.out.println(4%a); System.out.println(5%a); System.out.println(6%a); } } 결과는 아래와 같다. 0 1 2 0 1 2 0 즉, 나머지를 출력 2. 형변환 public class DivisionDemo { public sta..
형변환(Type Conversion) 1. 자동 형 변환 - double a = 3.0F; // double 타입이 float 타입보다 더 많은 수를 표현할 수 있기 때문에 에러가 안난다. - float a = 3.0; // 3.0이 double형 데이터고 a는 float 데이터 이므로 double형 변수를 float에 담으려고 하기 때문에 오류가 난다. 이유는 표현범위가 float short, char -> int -> long -> float -> double - byte ~ long는 정수 - float ~ double는 실수 (2) 예제 int a = 3; float b = 1.0F double c = a + b; // ???..