Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- JavaScript
- java
- 주식 청약
- 리눅스
- Oracle
- 맥
- html
- 자바스크립트
- 7월 공모주 청약 일정
- 공모주 청약 일정
- 오라클
- 주식 청약 일정
- Stock ipo
- 공모주
- 제이쿼리
- Stock
- Eclipse
- MYSQL
- 6월 공모주 청약 일정
- 코드이그나이터
- codeigniter
- IPO
- 공모주 청약
- SQL
- css
- 주식
- php
- 자바
- jquery
- linux
Archives
- Today
- Total
개발자의 끄적끄적
[kotlin] kotlin random number example / 코틀린 랜덤 난수 생성 방법 본문
728x90
반응형
[kotlin] kotlin random number example / 코틀린 랜덤 난수 생성 방법
kotlin 에서
랜덤수를 추출하고 싶은 경우가 있습니다.
그럴때는 Random 객체의
nextInt 를 이용하시면 됩니다.
Random().nextInt(1000)
예를들어서
0에서부터 1000사이의 랜덤수를 추출하고 싶은 경우에는 위처럼
nextInt 에 1000을 넣어주시면 됩니다!
참고들 하세요!
반응형
'개발 > kotlin' 카테고리의 다른 글
| [kotlin] kotlin newline example / 코틀린 엔터 줄바꿈 처리방법 (0) | 2022.05.06 |
|---|---|
| [kotlin] kotlin toString example / 코틀린 특정값을 문자열로 변경한는 방법 (0) | 2021.07.28 |
| [kotlin] kotlin max() example / 코틀린 컬렉션 최대값 구하는 방법 (0) | 2021.07.04 |
| [kotlin] kotlin last() example / 코틀린 리스트 마지막 요소 가져오는 방법 (0) | 2021.07.04 |
| [kotlin] kotlin isNullOrEmpty example / 코틀린 변수 null 체크 방법 (0) | 2021.07.04 |
Comments