$_SERVER['HTTP_USER_AGENT'] = Java/1.7.0_21
就跳過
2013年9月13日 星期五
2013年9月12日 星期四
【職訓局-手機程式開發班】2013 9/11 java
CLASS ex1:
class aa{
public int x, y;
public bb b;
aa(int x, int y){
this.x = x;
this.y = y;
b = new bb(this.x, this.y);
}
public String area(){
return "x:" + this.x + ",y:" + this.y + ",面積為:" + b.area();
}
public String perimeter(){
return "x:" + this.x + ",y:" + this.y + ",邊長為:" + b.perimeter();
}
}
class bb{
public int x, y;
public cc c;
bb(int x, int y){
this.x = x;
this.y = y;
c = new cc(this.x, this.y);
}
public int area(){
return this.x * this.y;
}
public int perimeter(){
return c.perimeter();
}
}
class cc{
public int x, y;
cc(int x, int y){
this.x = x;
this.y = y;
}
public int perimeter(){
return 2 * (this.x + this.y);
}
}
public class test01 {
public static void main(String[] args) {
aa a = new aa(10,20);
a.b.x = 100;
System.out.println(a.area());
a.b.c.x = 1000;
System.out.println(a.perimeter());
}
}
CLASS ex2:
package ch09;
class aa{
public int x, y;
public bb b;
aa(int x, int y){
this.x = x;
this.y = y;
b = new bb(this.x, this.y);
}
public String area(){
return "x:" + this.x + ",y:" + this.y + ",面積為:" + b.area();
}
public String perimeter(){
return "x:" + this.x + ",y:" + this.y + ",邊長為:" + b.perimeter();
}
}
class bb{
public int x, y;
public cc c;
bb(int x, int y){
this.x = x;
this.y = y;
c = new cc(this.x, this.y);
}
public int area(){
return this.x * this.y;
}
public int perimeter(){
return c.perimeter();
}
}
class cc{
public int x, y;
cc(int x, int y){
this.x = x;
this.y = y;
}
public int perimeter(){
return 2 * (this.x + this.y);
}
}
public class test01 {
public static void main(String[] args) {
aa a = new aa(10,20);
a.b.x = 100;
System.out.println(a.area());
a.b.c.x = 1000;
System.out.println(a.perimeter());
}
}
class aa{
public int x, y;
public bb b;
aa(int x, int y){
this.x = x;
this.y = y;
b = new bb(this.x, this.y);
}
public String area(){
return "x:" + this.x + ",y:" + this.y + ",面積為:" + b.area();
}
public String perimeter(){
return "x:" + this.x + ",y:" + this.y + ",邊長為:" + b.perimeter();
}
}
class bb{
public int x, y;
public cc c;
bb(int x, int y){
this.x = x;
this.y = y;
c = new cc(this.x, this.y);
}
public int area(){
return this.x * this.y;
}
public int perimeter(){
return c.perimeter();
}
}
class cc{
public int x, y;
cc(int x, int y){
this.x = x;
this.y = y;
}
public int perimeter(){
return 2 * (this.x + this.y);
}
}
public class test01 {
public static void main(String[] args) {
aa a = new aa(10,20);
a.b.x = 100;
System.out.println(a.area());
a.b.c.x = 1000;
System.out.println(a.perimeter());
}
}
CLASS ex2:
package ch09;
class aa{
public int x, y;
public bb b;
aa(int x, int y){
this.x = x;
this.y = y;
b = new bb(this.x, this.y);
}
public String area(){
return "x:" + this.x + ",y:" + this.y + ",面積為:" + b.area();
}
public String perimeter(){
return "x:" + this.x + ",y:" + this.y + ",邊長為:" + b.perimeter();
}
}
class bb{
public int x, y;
public cc c;
bb(int x, int y){
this.x = x;
this.y = y;
c = new cc(this.x, this.y);
}
public int area(){
return this.x * this.y;
}
public int perimeter(){
return c.perimeter();
}
}
class cc{
public int x, y;
cc(int x, int y){
this.x = x;
this.y = y;
}
public int perimeter(){
return 2 * (this.x + this.y);
}
}
public class test01 {
public static void main(String[] args) {
aa a = new aa(10,20);
a.b.x = 100;
System.out.println(a.area());
a.b.c.x = 1000;
System.out.println(a.perimeter());
}
}
2013年9月11日 星期三
【語言比較】1.class
JAVA
class:
class a01{
private int x;
int y;
public void setx(int x){
this.x = x;
}
public int getx(){
return this.x;
}
public int area(){
return this.x * this.y;
}
}
使用
a01 a = new a01();
a.setx(10);
a.y = 20;
system.out.print(a.area());
ObjectiveC
a01.h檔
@property int x,y;
- (void) setx:(int)x;
- (int) getx();
- (int) area();
a01.m檔
@synthesize x,y;
- (void) setx:(int)setX{
x = setX;
}
- (int) getx(){
return x;
}
- (int) area(){
return x*y;
}
使用
a01 *a = [[a01 alloc] init]
[a setx:10]
a.y = 20;
NSLog(@"%i",[a area]);
PHP
class:
class a01{
private $x;
public $y;
public function setx($x){
$this->x = $x;
}
public function getx(){
return $this->x;
}
public function area(){
return $this->x * $this->y;
}
}
使用
$a = new a01();
$a->setx(10);
$a->y = 20;
echo $a->area();
Javascript (網頁)
class:
function a01() {
this.x;
this.y;
this.setx = function(x) {
this.x = x;
}
this.getx = function(){
return this.x;
}
this.area = function(){
return this.x * this.y;
}
}
使用
var a = new a01();
a.setx(10);
a.y = 20;
document.write(a.area());
【mysql】不常用語法
1. is Null
SELECT * FROM user WHERE address is Null
2.is not Null
SELECT * FROM user WHERE address is not Null
3.not like
SELECT * FROM user WHERE address not like '_中%'
4.view 建立及移除暫存資料表
create view tmp as SELECT * FROM user WHERE address is Null
drop view tmp
5.distinct 重複的不計
SELECT count(distinct address) FROM user WHERE address is Null
SELECT * FROM user WHERE address is Null
2.is not Null
SELECT * FROM user WHERE address is not Null
3.not like
SELECT * FROM user WHERE address not like '_中%'
4.view 建立及移除暫存資料表
create view tmp as SELECT * FROM user WHERE address is Null
drop view tmp
5.distinct 重複的不計
SELECT count(distinct address) FROM user WHERE address is Null
2013年9月10日 星期二
2013年9月9日 星期一
2013年9月5日 星期四
【職訓局-手機程式開發班】2013 9/4 Java
1.參照
package test;
class A{
int aa = 10;
}
class B{
void c(A a){ // 可以傳類別近來
a.aa = 3;
}
}
public class class_text {
public static void main(String[] args) {
A a = new A();
B b = new B();
b.c(a);
System.out.println(a.aa); // a.aa = 3
}
}
2.呼叫自己的functionpackage test;
public class class_test2 {
int i;
public static void main(String[] args) {
class_test2 c = new class_test2(); // 自己
c.i = 10;
c.A();
}
void A(){
System.out.println(i);
}
}
2013年9月3日 星期二
2013年9月2日 星期一
【職訓局-手機程式開發班】2013 8/28 Unity coding
2013年8月28日 星期三
訂閱:
意見 (Atom)





















