關於我自己

我的相片
Welcome to discuss about : Chinese Traditional Medicine and Acupuncture Please send me the email: tccnchsu@gmail.com Chih-Yu Hsu

最新消息

總瀏覽量

2009年3月5日 星期四

第三週 java 程式

-----------------------------------------------------------------------------

第三週 物件導向設計-java 程式

-----------------------------------------------------------------------------
存檔 教學

25 則留言:

提到...

上課錄影
http://www.powercam.cc/slide/1133

志宇 許 提到...

/*
* Copyright 1999 by DAI Lab.
*
* The Distributed Artificial Laboratory
* Department of Information Management
* National Kaohsiung First University of Science and Technology
*
* Unauthorized distribution is prohibited.
*/

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
try{
FileOutputStream fos = new FileOutputStream
("/tmp/hello");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println("Hello World");
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}

aoitsukikage 提到...
作者已經移除這則留言。
提到...
作者已經移除這則留言。
d9538905 提到...
作者已經移除這則留言。
靖文 提到...
作者已經移除這則留言。
歐地 提到...
作者已經移除這則留言。
歐地 提到...

//D9539125 應數三甲 黃培熏
import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
Addop ap = new Addop();
try{
FileOutputStream fos = new FileOutputStream("c://HPS_Java//test.txt");
BufferedOutputStream bos = new BufferedOutputStream(fos);
PrintStream ps = new PrintStream(bos);

ps.println("X = "+ap.x+", Y = "+ap.y);
ps.println("X+Y = "+ap.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}

class Addop
{
public int x,y,z;
Addop()
{
try
{
x=1;
y=2;
z=x + y;
}
catch(Exception e)
{
System.out.println("除數不可為零!!");
}
}
}

黃鉦權 提到...

//應數三甲 黃鉦權 D9582506
import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
Addop ap=new Addop();
try{
int x;
FileOutputStream fos = new FileOutputStream
("c:\\myjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(ap.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}

class Addop
{
public int x,y,z;

Addop()
{try{
x=1;
y=2;
z=x+y;
}
catch(Exception e)
{
System.out.println("除數不可為零");
}
}
}

提到...

//D9476995 辛為儒

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
try{
FileOutputStream fos = new FileOutputStream("C:\\myjava2\\test.txt");

BufferedOutputStream bos = new BufferedOutputStream(fos);

PrintStream ps = new PrintStream(bos);

Addop myadd = new Addop();

ps.println(myadd.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}


class Addop{
public int x,y,z;
Addop(){
try{
x=1;
y=2;
z=x+y;
}
catch(Exception e){
System.out.print("除數不可為零");
}

}
}

靖文 提到...

D9539108 陸靖文
import java.io.*;
class b3 extends Object
{
public static void main(String[] args)
{
Addop bdd=new Addop();

try{
FileOutputStream fos = new FileOutputStream("C:\\Myjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);
ps.println(bdd.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}

File bfile=new File("C:\\Myjava\\test.txt");
if (bfile.exists())
{
System.out.print("有檔案");
}
else
{
System.out.print("找不到檔案");
}
}
}
class Addop
{
public int x,y,z;
Addop()
{
try
{
x=3;
y=1;
z=x+y;
}
catch(Exception e)
{
System.out.print("除數不可為0");
}
}
}

aoitsukikage 提到...

//光電四D9427925

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
Addop myadd=new Addop();
try{
FileOutputStream fos = new FileOutputStream
("C:\\Myjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(myadd.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}


class Addop
{
public int x,y;
public double z;
Addop()
{
try
{
x=20;y=7;
z=x+y;
}
catch(Exception e)
{
System.out.println("除數不可為零");
}
}
}

提到...

//D9377831 劉羽程
import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){

try{
FileOutputStream fos = new FileOutputStream("C:\\Myjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream(fos);
PrintStream ps = new PrintStream(bos);
Addop myplus=new Addop();
ps.println(myplus.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}

class Addop
{
public int x,y,z;
Addop()
{
x=1;
y=2;
z=x+y;
}
}

東東 提到...

數三乙 吳東翰 d9746738

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
Addop myadd=new Addop();
try{
FileOutputStream fos = new FileOutputStream
("C:\\Myjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(myadd.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}


class Addop
{
public int x,y;
public double z;
Addop()
{
try
{
x=1;y=7;
z=x+y;
}
catch(Exception e)
{
System.out.println("除數不可為零");
}
}
}

何孟弦 提到...

/*何孟弦 D9648991*/
*/
/*
* Copyright 1999 by DAI Lab.
*
* The Distributed Artificial Laboratory
* Department of Information Management
* National Kaohsiung First University of Science and Technology
*
* Unauthorized distribution is prohibited.
*/

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object
{
public static void main(String args[])
{
Addop addwow = new Addop();
try
{
FileOutputStream fos = new FileOutputStream
("c:\\myjava1\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(addwow.z);
ps.close();
bos.close();
fos.close();
}
catch (Exception e)
{
System.err.println(e);
}
}
}

class Addop
{
public int x, y;
public double z;
Addop()
{
try
{
x = 1;
y = 3;
z = x + y;
}
catch (Exception e)
{
System.out.print("除數不可為零");
}
}
}

乃爸 提到...

/*應數三甲 D9538864 徐晟哲*/
import java.io.*;
class aaaa {
public static void main(String[] args)
{
File file=new File("C:\\notjava\\test.txt");

try{
int x;
x=11;
FileOutputStream fos = new FileOutputStream("C:\\notjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(x);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}


if(!file.exists())
{
System.out.println("沒有檔案");
}
else
{
System.out.println("有檔案");
}
Addop myadd=new Addop();
}
}
class Addop
{
public int x,y, z;
Addop()
{
try
{
x=1;
y=0;
z=x+y;
}
catch(Exception e)
{
System.out.print("除數不可為零");

}
}
}

子堡 提到...

/* D9582375 林子堡
* Copyright 1999 by DAI Lab.
*
* The Distributed Artificial Laboratory
* Department of Information Management
* National Kaohsiung First University of Science and Technology
*
* Unauthorized distribution is prohibited.
*/

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[])
{
addop myadd = new addop();
try{
FileOutputStream fos = new FileOutputStream
("C:\\ap6\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(myadd.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}


class addop
{
public int x, y, z;
addop()
{
try
{
x = 12;
y = 5;
z = x + y;
}

catch (Exception e)
{
System.out.print("除數不可為零");
}
}
}

d9538905 提到...

//D9538905 甘育濬

/*
* Copyright 1999 by DAI Lab.
*
* The Distributed Artificial Laboratory
* Department of Information Management
* National Kaohsiung First University of Science and Technology
*
* Unauthorized distribution is prohibited.
*/

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
Addop addop=new Addop();
try{
FileOutputStream fos = new FileOutputStream("C:\\D9538905\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(addop.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}
class Addop
{
int y,x;
int z;
Addop()
{

x=1;
y=10;
z=x+y;
}
}

乃爸 提到...

/*D9538864 應數3甲 徐晟哲*/
import java.io.*;
class aaaa {
public static void main(String[] args)
{
File file=new File("C:\\notjava\\test.txt");

try{
int x,y,z;
x=1;
y=2;
z=x+y;
FileOutputStream fos = new FileOutputStream("C:\\notjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}


if(!file.exists())
{
System.out.println("沒有檔案");
}
else
{
System.out.println("有檔案");
}
Addop myadd=new Addop();
}
}
class Addop
{
public int x,y, z;
Addop()
{
try
{
x=1;
y=0;
z=x+y;
}
catch(Exception e)
{
System.out.print("除數不可為零");

}
}
}

益銘梁 提到...

// 應數3甲 梁益銘
import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){
Addop ap=new Addop();
try{
int x;
FileOutputStream fos = new FileOutputStream
("c:\\myjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(ap.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}

class Addop
{
public int x,y,z;

Addop()
{try{
x=0;
y=2;
z=x+y;
}
catch(Exception e)
{
System.out.println("除數不可為零");
}
}
}

dragon 提到...

d9582608

import java.io.*;
import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
public class stack3 extends Object{
public static void main(String args[]){
try{
FileOutputStream fos = new FileOutputStream
("C:\\dark\\text.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);
a b =new a();
ps.println(z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}
class a
{
int x,y,z;
{
a()
{
x=1;
y=2;
z=x+y;
}
}
}

提到...

//陳秋宇

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class Myfirstjava extends Object{
public static void main(String args[]){
try{
FileOutputStream fos = new FileOutputStream("C:\\Myjava\\test.txt");

BufferedOutputStream bos = new BufferedOutputStream(fos);

PrintStream ps = new PrintStream(bos);

Addop myadd = new Addop();

ps.println(myadd.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}


class Addop{
public int x,y,z;
Addop(){
try{
x=1;
y=2;
z=x+y;
}
catch(Exception e){
System.out.print("除數不可為零");
}

}
}

Wang 提到...

/*
* Copyright 1999 by DAI Lab.
*
* The Distributed Artificial Laboratory
* Department of Information Management
* National Kaohsiung First University of Science and Technology
*
* Unauthorized distribution is prohibited.
*/

import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class stack3 extends Object{
public static void main(String args[]){

Addop myadd=new Addop();
try{


FileOutputStream fos = new FileOutputStream
("c:\\Myjava\\test.txt");
BufferedOutputStream bos = new BufferedOutputStream
(fos);
PrintStream ps = new PrintStream(bos);

ps.println(myadd.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}

class Addop
{
public int x,y;
public int z;
Addop()
{
try
{
x=123;
y=723;
z=x+y;
}
catch(Exception e)
{
System.out.println("除數不可為零");
}
}
}

D9788173 王則元

123 提到...
作者已經移除這則留言。
123 提到...

//D9538922 應數三甲 陳駿岳
import java.io.PrintStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class mythirdjava extends Object{
public static void main(String args[]){
Addop add = new Addop();
try{
FileOutputStream fos = new FileOutputStream("c://myjava1//test.txt");
BufferedOutputStream bos = new BufferedOutputStream(fos);
PrintStream ps = new PrintStream(bos);

ps.println("X+Y="+add.z);
ps.close();
bos.close();
fos.close();
}catch(Exception e){
System.err.println(e);
}
}
}

class Addop
{
public int x,y,z;
Addop()
{
try
{
x=1;
y=2;
z=x + y;
}
catch(Exception e)
{
System.out.println("除數不可為零!!");
}
}
}