'2017/10'에 해당되는 글 16건
- 2017.10.19 자바 숫자 문자 변환
- 2017.10.18 자바 랜덤 숫자 발생 정렬 후 반환 353
- 2017.10.15 안드로이드 화면 회전 및 로딩 흰색 화면 방지 7
- 2017.10.14 DELETE_FAILED_INTERNAL_ERROR 6
자바 랜덤 숫자 발생 정렬 후 반환
import java.util.Arrays;
import java.util.Random;
/**
* Created by buster on 17. 9. 14.
*/
public class randomNum {
public int[] lotArray(int input1, int input2) {
int[] num = new int[input1];
int lottoMax = input2;
int MAX = input1;
int xnum;
int icount, j;
Random rand = new Random();
// 로또 번호 발생 및 중복 제거
for (icount = 0; icount < MAX; icount++) {
xnum = rand.nextInt(lottoMax) + 1;
num[icount] = xnum;
for (j = 0; j < icount; j++) {
if (num[icount] == num[j]) {
xnum = rand.nextInt(lottoMax) + 1;
num[icount] = xnum;
icount = icount - 1;
break;
}
}
}
// 오름 차순으로 정렬 및 리턴 어레이 전달
Arrays.sort(num);
return num;
}
}
'IT > java' 카테고리의 다른 글
java split() 문자 자르기 (684) | 2017.10.27 |
---|---|
자바 자문 자답 DecimalFormat 에러 발생 (627) | 2017.10.21 |
로딩시 화면 흰색 제거
와 화면 회전시 센서에의한 회전 과 내용 refresh 방지
AndroidManifest.xml
android:configChanges="orientation|screenSize"
android:screenOrientation="sensor">
styles.xml
//로딩시 화면 흰색 제거
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsTranslucent">true</item>
'IT > android' 카테고리의 다른 글
당장 플레이스토어에 올리면 돈되는 로또앱. (16) | 2022.03.31 |
---|---|
안드로이드 스튜디오 네트웍 체크 (7) | 2017.10.20 |
DELETE_FAILED_INTERNAL_ERROR (6) | 2017.10.14 |
안드로이드 스튜디오 화면 고정 (4) | 2017.10.09 |
navi bar image src (2) | 2017.09.07 |
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APKs
File > Settings > Build, Execution, Deployment > Instant Run > Uncheck : Enable Instant Run
'IT > android' 카테고리의 다른 글
당장 플레이스토어에 올리면 돈되는 로또앱. (16) | 2022.03.31 |
---|---|
안드로이드 스튜디오 네트웍 체크 (7) | 2017.10.20 |
안드로이드 화면 회전 및 로딩 흰색 화면 방지 (7) | 2017.10.15 |
안드로이드 스튜디오 화면 고정 (4) | 2017.10.09 |
navi bar image src (2) | 2017.09.07 |