토요일, 12월 21
Shadow

[글쓴이:] nobaksan

#003 Object Detail

미분류
Point originOne = new Point(23, 94); Rectangle rectOne = new Rectangle(originOne, 100, 200); Rectangle rectTwo = new Rectangle(50, 100); first line creates an object from the Point class and the second and third lines each create an object from the Rectangle class. Declaration: The code set in bold are all variable declarations that associate a variable name with an object type. Instantiation: The new keyword is a Java operator that creates the object. As discussed below, this is also known as instantiating a class. Initialization: The new operator is followed by a call to a constructor. For example, Point(23, 94) is a call to Point's only constructor. The constructor initializes the new object. The declared type matches the class of the object: MyClass myObject = new MyClass(); ...

#002 정렬 두가지 방법 순차정렬(앞뒤)

미분류
/* * Main.java * * Created on 2006년 7월 25일 (화), 오전 11:12 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package array; /** * * @author Administrator */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String args[]) { int[] ArrayData ={10,20,50,45,4,22,31,41}; int[] ArrayData1={10,20,50,45,4,22,31,41}; //postfix for(int i=0;i<ArrayData.length;i++){ for(int j=i;j<ArrayData.length;j++){ if(ArrayData[j]<ArrayData[i]){ int temp=ArrayData[j]; ArrayData[j]=ArrayData[i...

#001 OPERATOR

미분류
<<  op1 << op2  Shifts bits of op1 left by distance op2; fills with 0 bits on the right side >>  op1 >> op2  Shifts bits of op1 right by distance op2; fills with highest (sign) bit on the left side >>>  op1 >>> op2  Shifts bits of op1 right by distance op2; fills with 0 bits on the left side &  op1 & op2  Bitwise AND if both operands are numbers; conditional AND if both operands are boolean |  op1 | op2  Bitwise OR if both operands are numbers; conditional OR if both operands are boolean ^  op1 ^ op2  Bitwise exclusive OR (XOR) ~  ~op  Bitwise complement AND 0 0 0 0 1 0 1 0 0 1 1 1 OR 0 0 0 0 1 1 1 0 1 1 1 1 XOR 0 0 0 0 1 1 1 0 1 1 1 0 static final int VISIBLE = 1; static final int DRAGGABLE = 2; static fin...