일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 데이터베이스
- Data structure
- It
- 백준
- 캐싱
- Dijkstra
- java
- 레디스
- 프로그래머스
- deque
- 알고리즘
- 플로이드-워셜 알고리즘
- 완전탐색
- CS
- javascript
- 자료구조
- jpa
- 영속성 컨텍스트
- CSS
- db
- OS
- 아키텍처
- nosql
- Algorithm
- PYTHON
- BFS
- DFS
- 운영체제
- HTML
- redis
Archives
- Today
- Total
목록Java (11)
If at first you don't succeed, try again
[Java] Math.random 메서드
* 개요 자바로 코딩할 때, 난수를 생성해야 할 때가 있다. 그 때마다 자꾸 Math.random 메서드를 까먹는다. 까먹지 않기 위해 포스팅을 하기로 하였다. * Math.random 메서드 public class test { public static void main(String[] args) { double data = Math.random(); System.out.println(data); // 0.0.. ~ 1.0..까지의 난수 생성 System.out.println((int)(data * 10)); // 0 ~ 10까지의 난수 생성 System.out.println((int)(data * 100)); // 0 ~ 100까지의 난수 생성 System.out.println((int)(data * ..
Java/Java
2022. 12. 24. 00:26