class Subject{ String name; int score; int credit; public Subject(String name, int score, int credit) { super(); this.name = name; this.score = score; this.credit = credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分"+credit); } } public class ex2 {
class Subject{ String name; int score; int credit; public Subject(String name,int score, int credit){ this.name = name; this.score = score; this.credit = credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分:"+credit); } } public class ex1 {
public static void main(String[] args) { Subject X = new Subject("程式" , 90, 3); X.print(); Subject y = new Subject("國文" , 90, 3); y.print(); Subject z = new Subject("數學" , 90, 3); z.print(); }
class Subject{ String name; int score; int credit; public Subject(String name, int score, int credit){ this.name=name; this.score=score; this.credit= credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分:"+credit); } } public class ex01 {
public static void main(String[] args) { Subject x=new Subject("程式",90,3); x.print();
class Subject{ String name; int score; int credit; public Subject(String name, int score, int credit){ this.name=name; this.score=score; this.credit= credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分:"+credit); } } public class ex01 {
public static void main(String[] args) { Subject x=new Subject("程式",90,3); x.print();
class Subject{ String name; int score; int credit; public Subject(String name, int score, int credit){ this.name=name; this.score=score; this.credit= credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分:"+credit); } } public class ex01 {
public static void main(String[] args) { Subject x=new Subject("程式",90,3); x.print();
class Subject{ String name; int score; int credit; public Subject(String name, int score, int credit){ this.name=name; this.score=score; this.credit= credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分:"+credit); } } public class ex01 {
public static void main(String[] args) { Subject x=new Subject("程式",90,3); x.print();
class Subject{ String name; int score; int credit; public Subject(String name, int score, int credit){ this.name=name; this.score=score; this.credit= credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分:"+credit); } } public class ex01 {
public static void main(String[] args) { Subject x=new Subject("程式",90,3); x.print();
class Subject{ String name; int score; int credit; public Subject(String name, int score, int credit){ this.name=name; this.score=score; this.credit= credit; } void print(){ System.out.println (name+":"+"\t分數:"+score+"\t學分:"+credit); } } public class ex01 {
public static void main(String[] args) { Subject x=new Subject("程式",90,3); x.print();
59 則留言:
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void println(){
System.out.println
(name+" : "+"分數 "+score+" 學分 : "+credit);
}
}
public class ex5
{
public static void main(String[] args)
{
Subject x=new Subject("程式I",90,3);
x.println();
Subject y=new Subject("程式II",91,2);
y.println();
Subject z=new Subject("程式III",92,1);
z.println();
}
}
程式I : 分數 90 學分 : 3
程式II : 分數 91 學分 : 2
程式III : 分數 92 學分 : 1
class S{
String name;
int X;
int Y;
public S(String name, int X, int Y) {
super();
this.name = name;
this.X = X;
this.Y = Y;
}
void print(){
System.out.println(name+":"+X+"分\t"+Y+"學分");
}
}
public class a01 {
public static void main(String[] args) {
S x[]=new S[3];
x[0]=new S("程式",60,4);
x[1]=new S("國文",75,2);
x[2]=new S("統計",60,2);
for(S a:x) a.print();
}
}
package w2;
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
super();
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
}
}
public class hw1 {
public static void main(String[] args) {
Subject X[]= new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("管理",70,3);
X[2]=new Subject("資料庫",80,3);
for(Subject a:X)
a.print();
}
}
class Subject
{
String name;
int score;
int credit;
public Subject(String name, int score, int credit)
{
this.name = name;
this.score = score;
this.credit = credit;
}
void print()
{
System.out.println(name+"\t名稱:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args)
{
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("數學",60,4);
X[2]=new Subject("國文",80,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
super();
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分"+credit);
}
}
public class ex2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",85,2);
X[2]=new Subject("資料庫",80,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",90 ,3);
X[1]=new Subject("資料結構",88 ,3);
X[2]=new Subject("生產管理",85 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",80 ,4);
X[1]=new Subject("資料結構",90 ,3);
X[2]=new Subject("生產管理",88 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",88 ,3);
X[1]=new Subject("資料結構",90 ,3);
X[2]=new Subject("生產管理",82 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score,int credit){
this.name=name;
this.score=score;
this.credit=credit;
}
void print(){
System.out.println(name+":"+"分數:"+score+"學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject x[]=new Subject[3];
x[0]=new Subject("英文",60,3);
x[1]=new Subject("程式",70,3);
x[2]=new Subject("數學",80,1);
for(Subject a:x);
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("微積分",65 ,2);
X[1]=new Subject("進階程式設計",82 ,2);
X[2]=new Subject("企業電子化",77 ,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",85 ,3);
X[1]=new Subject("資料結構",90 ,3);
X[2]=new Subject("生產管理",92 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score,int credit){
this.name= name;
this.score=score;
this.credit=credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex5 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",88 ,3);
X[1]=new Subject("資料結構",90 ,3);
X[2]=new Subject("生產管理",85 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("微積分",70 ,2);
X[1]=new Subject("英文",65 ,3);
X[2]=new Subject("體育",95 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
super();
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class HW1 {
public static void main(String[] args) {
Subject X=new Subject("程式",90,3);
X.print();
Subject Y=new Subject("國文",100,3);
Y.print();
Subject Z=new Subject("數學",100,3);
Z.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",80,3);
X[1]=new Subject("國文",90,2);
X[2]=new Subject("會計",70,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score,int credit){
this.name=name;
this.score=score;
this.credit=credit;
}
void print(){
System.out.println
(name+":"+"分數"+score+"學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject X=new Subject("程式",80,3);
Subject Y=new Subject("英文",75,2);
Subject Z=new Subject("數學",86,2);
X.print();
Y.print();
Z.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",90 ,3);
X[1]=new Subject("資料結構",88 ,3);
X[2]=new Subject("生產管理",85 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X=new Subject("程式",90,3);
X.print();
Subject Y=new Subject("國文",90,3);
Y.print();
Subject Z=new Subject("數學",90,3);
Z.print();
}
}
package date1;
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
super();
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name + ":" + "分數:" +score + "學分:" + credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject X = new Subject("程式" , 90, 3);
X.print();
Subject y = new Subject("國文" , 90, 3);
y.print();
Subject z = new Subject("數學" , 90, 3);
z.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",99 ,3);
X[1]=new Subject("資料結構",88 ,3);
X[2]=new Subject("生產管理",77 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",55 ,3);
X[1]=new Subject("資料結構",66 ,3);
X[2]=new Subject("生產管理",77 ,2);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
super();
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X=new Subject("程式",90,3);
X.print();
Subject Y=new Subject("微積分",90,3);
Y.print();
Subject Z=new Subject("經濟學",90,3);
Z.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class ex01 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new subject("程式",90,3);
X[1]=new subject("微積分",80,2);
X[1]=new subject("英文",88,1);
for(subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
super();
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X=new Subject("程式",90,3);
X.print();
Subject Y=new Subject("微積分",90,3);
Y.print();
Subject Z=new Subject("會計",90,3);
Z.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit= credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject x=new Subject("程式",90,3);
x.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit= credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject x=new Subject("程式",90,3);
x.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
public class hw2 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("微積分",80,2);
X[2]=new Subject("英文",88,1);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("基礎統計學",88 ,3);
X[1]=new Subject("生產管理",84 ,3);
X[2]=new Subject("程式設計",86 ,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("基礎統計學",75 ,3);
X[1]=new Subject("生產管理",68 ,3);
X[2]=new Subject("程式設計",74 ,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.print
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("英文",82,1);
X[1]=new Subject("人文藝術-西方藝術經典選粹",80 ,2);
X[2]=new Subject("行銷管理",62 ,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("基礎統計學",75 ,3);
X[1]=new Subject("生產管理",68 ,3);
X[2]=new Subject("程式設計",74 ,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex1 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("程式設計",80 ,2);
X[1]=new Subject("作業系統",76 ,3);
X[2]=new Subject("生產管理資訊系統",85 ,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name,int score, int credit){
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.print
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("英文",68,1);
X[1]=new Subject("人文藝術-西方藝術經典選粹",78 ,2);
X[2]=new Subject("資訊網路",60 ,3);
for(Subject a:X)
a.print();
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit=credit;
}
void print(){
System.out.println
("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex5 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("英文",90,1);
X[1]=new Subject("程式設計",60,3);
X[2]=new Subject("資料庫",80,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void println(){
System.out.println
(name+" : "+"分數 "+score+" 學分 : "+credit);
}
}
public class ex5
{
public static void main(String[] args)
{
Subject x=new Subject("程式I",90,3);
x.println();
Subject y=new Subject("程式II",91,2);
y.println();
Subject z=new Subject("程式III",92,1);
z.println();
}
}
程式I : 分數 90 學分 : 3
程式II : 分數 91 學分 : 2
程式III : 分數 92 學分 : 1
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit= credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject x=new Subject("程式",90,3);
x.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void println(){
System.out.println
(name+" : "+"分數 "+score+" 學分 : "+credit);
}
}
public class ex5
{
public static void main(String[] args)
{
Subject x=new Subject("程式I",90,3);
x.println();
Subject y=new Subject("程式II",91,2);
y.println();
Subject z=new Subject("程式III",92,1);
z.println();
}
}
程式I : 分數 90 學分 : 3
程式II : 分數 91 學分 : 2
程式III : 分數 92 學分 : 1
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit=credit;
}
void print(){
System.out.println
("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex5 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("英文",90,1);
X[1]=new Subject("程式設計",60,3);
X[2]=new Subject("資料庫",80,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit=credit;
}
void print(){
System.out.println
("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex5 {
public static void main(String[] args) {
Subject X[]=new Subject[3];
X[0]=new Subject("英文",90,1);
X[1]=new Subject("程式設計",60,3);
X[2]=new Subject("資料庫",80,3);
for(Subject a:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit= credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject x=new Subject("程式",90,3);
x.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit= credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject x=new Subject("程式",90,3);
x.print();
}
}
class S{
String name;
int X;
int Y;
public S(String name, int X, int Y) {
super();
this.name = name;
this.X = X;
this.Y = Y;
}
void print(){
System.out.println(name+":"+X+"分\t"+Y+"學分");
}
}
public class a01 {
public static void main(String[] args) {
S x[]=new S[3];
x[0]=new S("程式",60,4);
x[1]=new S("國文",75,2);
x[2]=new S("統計",60,2);
for(S a:x) a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit){
this.name=name;
this.score=score;
this.credit= credit;
}
void print(){
System.out.println
(name+":"+"\t分數:"+score+"\t學分:"+credit);
}
}
public class ex01 {
public static void main(String[] args) {
Subject x=new Subject("程式",90,3);
x.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void println(){
System.out.println
(name+" : "+"分數 "+score+" 學分 : "+credit);
}
}
public class ex5
{
public static void main(String[] args)
{
Subject x=new Subject("程式I",90,3);
x.println();
Subject y=new Subject("程式II",91,2);
y.println();
Subject z=new Subject("程式III",92,1);
z.println();
}
}
程式I : 分數 90 學分 : 3
程式II : 分數 91 學分 : 2
程式III : 分數 92 學分 : 1
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void println(){
System.out.println
(name+" : "+"分數 "+score+" 學分 : "+credit);
}
}
public class ex5
{
public static void main(String[] args)
{
Subject x=new Subject("程式I",90,3);
x.println();
Subject y=new Subject("程式II",91,2);
y.println();
Subject z=new Subject("程式III",92,1);
z.println();
}
}
程式I : 分數 90 學分 : 3
程式II : 分數 91 學分 : 2
程式III : 分數 92 學分 : 1
package w2;
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
super();
this.name = name;
this.score = score;
this.credit = credit;
}
void print(){
System.out.println
("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
}
}
public class hw1 {
public static void main(String[] args) {
Subject X[]= new Subject[3];
X[0]=new Subject("程式",90,3);
X[1]=new Subject("管理",70,3);
X[2]=new Subject("資料庫",80,3);
for(Subject a:X)
a.print();
}
}
包W2;
類主題{
字符串名稱;
INT分;
詮釋信用;
公共科目(字符串名稱,詮釋得分,詮釋信貸){
超();
this.name =名稱;
this.score =得分;
this.credit =貸款;
}
無效的print(){
的System.out.println
(“名稱:”+姓名+“\ t分數:”+分數+“\ t學分:”+信用);
}
}
公共類HW1 {
公共靜態無效的主要(字串[] args){
主題X [] =新的主題[3];
X [0] =新主題(“程式”,90,3);
X [1] =新主題(“管理”,70,3);
X [2] =新主題(“資料庫”,80,3);
對於(但一個:X)
a.print();
}
}
class Subject{
String name;
int score;
int credit;
public Subject(String name, int score, int credit) {
this.name = name;
this.score = score;
this.credit = credit;
}
void println(){
System.out.println
(name+" : "+"分數 "+score+" 學分 : "+credit);
}
}
public class ex5
{
public static void main(String[] args)
{
Subject x=new Subject("程式I",90,3);
x.println();
Subject y=new Subject("程式II",91,2);
y.println();
Subject z=new Subject("程式III",92,1);
z.println();
}
}
程式I : 分數 90 學分 : 3
程式II : 分數 91 學分 : 2
程式III : 分數 92 學分 : 1
張貼留言