안드로이드의 VIew 클래스를 상속으면 onDraw() 메소드를 오버라이딩 할 수 있게 된다. public class Test extends Activity{ Myview mv; @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);mv = new Myview(this);setContentView(mv); buf = new byte[307200];Thread serverThread = new Thread(this);serverThread.start();} public void run() {//생략} class Myview extends View { public Myview(Context con..
public class ComputeABS { public static void main(String[] args) {// TODO Auto-generated method stub int value = 5;System.out.println(value + "'s Absolute Value = " + abs(value));value = -10;System.out.println(value + "'s Absolute Value = " + abs(value));} static int abs(int value) {// TODO Auto-generated method stubif(value < 0)value *= -1;return value;}}
public class ConfirmNum { static boolean isNumber(String str) { if (str == null)return false; for (int i = 0; i 58)return false;}return true;} public static void main(String[] args) {// TODO Auto-generated method stubString str = "123";S..
import java.util.Scanner; public class Television { public static void main(String[] args) {// TODO Auto-generated method stubSystem.out.println("TV 리모컨");MyTv mt = new MyTv(); mt.turnOnOff(); System.out.println("1. Channel Up");System.out.println("2. Channel Down");System.out.println("3. Volume Up");System.out.println("4. Volume Down"); while (true) {Scanner scan = new Scanner(System.in); int t..
public class ArrayShuffle { public static void main(String[] args) {// TODO Auto-generated method stub int[] ori = {1,2,3,4,5,6,7,8,9};System.out.println(java.util.Arrays.toString(ori));int[] result = shuffle(ori);System.out.println(java.util.Arrays.toString(result));} private static int[] shuffle(int[] result) {// TODO Auto-generated method stubint temp, seed;for(int i=0;i
/* * [5-11] 주어진 2차원 배열의 데이터보다 가로와 세로로 1이 더 큰 배열을 생성해서 배열 * 의 행과 열의 마지막 요소에 각 열과 행의 총합을 저장하고 출력하는 프로그램이다. (1) * 에 알맞은 코드를 넣어서 완성하시오. * */ class Exercise5_11 {public static void main(String[] args) {int[][] score = { { 100, 100, 100 }, { 20, 20, 20 }, { 30, 30, 30 },{ 40, 40, 40 }, { 50, 50, 50 } }; int[][] result = new int[score.length + 1][score[0].length + 1]; for (int i = 0; i < score.length; ..
/* * 이진검색 * 주어진 정렬된 배열 중에서 사용자가 입력한 키 값을 검색 * 키가 있으면 배열 인덱스와 함께 메시지 출력 * 키가 없으면 메시지 출력 */ package cbnu; import java.util.Scanner; public class BiSearch { public static void main(String[] args) {// TODO Auto-generated method stubint targetArray[] = { 4, 7, 12, 24, 31, 35, 37, 44, 45 };// 정렬이 된 배열 System.out.println("key값을 입력 : ");Scanner sc = new Scanner(System.in);int key = sc.nextInt();int mid ..
- Total
- Today
- Yesterday
- 졸업작품
- HTML
- 클래스
- 이론
- 프로젝트
- 자바스크립트
- 소켓
- 아두이노
- 청주
- SVN
- 오라클
- 파이썬
- 충북대
- 정보
- jsp
- 메모장
- 잡담
- ERP
- JQuery
- CSS
- 데이터베이스
- 알고리즘
- 배열
- db
- 게임
- 정렬
- 자바
- SQL
- 안드로이드
- 도전과제
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |