프로그래밍
Java Language -> 문법
밍딩이
2015. 7. 29. 21:06
Java Language 문법
class test{
멤버변수
int a; -> 기본데이터타임(프리미티브type)
String name; -> 레퍼런스데이터 타입
생성자
멤버메서드
public class RandomTest {
public static void main(String[] args) {
int [] numbers = new int[6];
for(int i=0; i<numbers.length; i++){
numbers[i]= (int)(Math.random()*45)+1;
for(int j=0; j<i; j++){
if(numbers[i]==numbers[j]){
i--;
}
}
}
for(int i=0;i<numbers.length;i++){
System.out.println(numbers[i]);
}
}
//1~45 로또 뽑기
//6개 뽑기
//prn
}