|
|
- ひでたつ のあき
- 5 years ago
- Views:
Transcription
1
2
3 Windows Linux Mac Windows Linux Mac
4
5 .java.class
6
7 $ javac Hello.java
8 $ java Hello Hello.class.class
9 Hello, world.
10 public class Hello{ public static void main(string args[]){ System.out.println("Hello, world.");
11 main public class Hello{ public static void main(string args[]){ System.out.println("Hello, world."); {
12 println System.out.println( ); System.out.println( abcd ); abcd System.out.println( abcd + efg ); System.out.println( var= +514); abcdefg var=514
13 n n System.out.println( ab ncd ); ab cd System.out.println( abc + d nef ); System.out.println( var n= +514); abcd ef var =514
14 print System.out.print( ); println System.out.println( abcd ); System.out.println( abcd + efg ); System.out.println( var= +514); System.out.print( abcd ); System.out.print( abcd + efg ); System.out.print( var= +514); abcd abcdefg var=514 abcdabcdef gvar=514
15 // /* */ /* */ System.out.println( abcd ); // OK abcd // //System.out.println( abc + def ); // System.out.println( var= +514); var=514
16 ##### *#### **### ***## ****# ***** public class Reidai21 { public static void main(string[] args) { System.out.println("#####"); System.out.println("*####"); System.out.println("**###"); System.out.println("***##"); System.out.println("****#"); System.out.println("*****");
17 * *** ***** ******* ***** *** *
18
19
20 println print ; int d; d = 10; System.out.println(d+ ); 10! double f = 3.14; System.out.println( +f); 3.14 char c = a ; System.out.println(c+ b c ); String str = Happy ; System.out.println(str+!!! ); a b c Happy!!!
21 * String stars0=" *"; *** String stars1=" ***"; ***** String stars2=" *****"; ******* String stars3="*******"; ***** *** *
22 int kamakura=1192; int muromachi=1338; int edo=1603; String bakufu=" "; String nen=" ";
23 char c0= ; char c1= ; char c2= ; char c3= ; char c4= ; char c10=' '; char c11=' '; char c12=' '; char c13=' '; char c14=' '; char c15=' '; ; char c5=' '; char c6=' '; char c7= '; char c8=' '; char c9=' ';
24 dt dt[0] dt[1] dt[2] int dt[] = new int[3];// (4.1) dt[1] = 25; System.out.println(dt[1]+ ); 25
25 dt[1]=25; int dt[]; int[] dt; dt=new int[3]; dt dt dt dt[0] dt[1] dt[2] dt[0] 25 dt[1] dt[2] int dt[] = new int[3];
26 dt dt.length int dt dt[0] dt[1] dt[2] dt.length dt int int dt[] = new int[3]; dt[dt.length-1] = 5; 10 dt[0] 25 dt[1] 5 dt[2]
27 double f = 3.14; int aa[] = {10,25,5; aa aa[0] aa[1] aa[2] double bb[] = {1.2, 3.3, 5.1; 1.2 bb[0] 3.3 bb[1] 5.1 bb[2] String ss[] = { abc, def, ghi ; ss abc ss[0] def ss[1] ghi ss[2]
28 int aa[] = {10,25,5; int bb[] = new int[3]; bb[0]=aa[0]; bb[1]=aa[1]; bb[2]=aa[2]; int bb[] = (int[])aa.clone(); aa bb int bb[] = new int[3]; System.arraycopy(aa,0,bb,0,aa.length); aa[0] aa[1] aa[2] aa[0] aa[1] aa[2]
29 A A A AAAAA A A public class Reidai41 { public static void main(string[] args) { String aa[]={ " A", " A A", " AAAAA", "A A", ; System.out.println(aa[0]); System.out.println(aa[1]); System.out.println(aa[2]); System.out.println(aa[3]);
30 String ss January ss[0] February ss[1] March ss[2] $ java Kadai41 January February March
31 String stars[]={" *, " ***, " *****, "******* ; * *** ***** ******* ***** *** *
32 * / % + - a = b * c ; a = b / c ; a = b % c ; a = b + c ; a = b - c ; a = 2 * 6 / * ( ) a = 12 / * 5 a =
33 a = 7 / 3 ; b = 7 % 3 ; a b a b a b
34 ++a; a++; a=a+1; --a; a--; a=a-1; b = a++; b = a; a = a+1; b = ++a; a = a+1; b = a; a += 3; a = a + 3; a *= 3; a = a * 3; -= /= %=
35 $ java reidai51 a, b a+b = 12 a-b = 4 a*b = 32 a/b = 2 public class Reidai51 { public static void main(string[] args) { int a=8;int b=4; System.out.println("a+b="+(a+b)); System.out.println("a-b="+(a-b)); System.out.println("a*b="+a*b); System.out.println("a/b="+a/b);
36 : System.out.println("a-b="+a-b); : "a-b="+a-b "a-b=8"-b
37 : System.out.println("a-b="+(a-b)); : "a-b="+(a-b) a-b= +4 "a-b=4
38 : System.out.println("a+b="+a+b); : a+b=84 "a+b="+a+b "a+b=8 +b a+b=84
39 : System.out.println("a+b="+(a+b)); : a+b=12 "a+b="+(a+b) "a+b= +12 a+b=12
40 : System.out.println("a*b="+a*b); : a*b=32 "a*b="+a*b "a*b= +32 a*b=32
41 : System.out.println("a/b="+a/b); : a/b=2 "a/b="+a/b "a/b= +2 a/b=2
42 a, b, c, d $ java kadai51 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = a+b*c+d = b/a+d/c = 4
43
44 java Input
45 import java.io.*; public class Input { public static void main(string[] args) throws IOException{ BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in)); String ss = kbd.readline(); System.out.println(ss);
46 kbd BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in)); kbd BufferedReader InputStreamReader System.in
47 kbd String ss = kbd.readline(); ss kbd.readline() BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in)); String ss1 = kbd.readline(); String ss2 = kbd.readline();
48 BufferedReader java.io.bufferedreader public class Input { public static void main(string[] args) throws java.io.ioexception{ java.io.bufferedreader kbd = new java.io.bufferedreader( new java.io.inputstreamreader(system.in)); String ss = kbd.readline(); System.out.println(ss); java.io. import java.io.*; import java.io.*; :... BufferedReader... : :... java.io.bufferedreader... :
49 ss kbd.readline() IOException throws public static void main(string[] args) throws IOException{
50 d ss kbd.readline() String ss = kbd.readline(); int d = Integer.parseInt(ss); String ss = kbd.readline(); double f = Double.parseDouble(ss);
51 $ java Radai61 input number : import java.io.ioexception; public class Reidai61 { public static void main(string[] args) throws IOException{ String ss; java.io.bufferedreader kbd = new java.io.bufferedreader( new java.io.inputstreamreader(system.in)); System.out.println("input number:"); ss = kbd.readline(); int d = Integer.parseInt(ss); System.out.println(d*3);
52
53 public final class DspInqueriesAction extends Action{ protected static Logger logger = Logger.getLogger(LoggingPlugIn.class.getName()); public ActionForward execute(actionmapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response){ String inqueriesdirectory = this.servlet.getinitparameter("inquery-directory")+"inqueries/"; logger.fine("(1)inqueriesdirectory="+inqueriesdirectory); ArrayList inquerylist = new ArrayList(); ActionErrors errors = FileAccess.setInqueryListFromFile(inqueriesDirectory,inqueryList); if(errors.size()!=0){ saveerrors(request,errors); return map.findforward("fault"); request.setattribute("inquery.list",inquerylist.toarray()); return map.findforward("success");
54 if while for do-while switch break continue return
55 print 1 print 2 print 3 i=1,3 print i n>0 print n illegal
56 if if if( ) { ; else{ ;
57 if if( ){ { else{ int a=0; int b=0; if (a==0){ b=1; else{ b=2; System.out.println( b= +b); a b=1
58 x 5 if(x<=5){ <= >= > < if(x>=5){ if(x>5){ if(x<5){ x 5 x 5 x 5 x 5 if(x!=5){!= == if(x==5){ x 5
59 String ss abc if(ss== abc ){ String ss abc if(ss.equals( abc )){ s1 s2 if(s1.equals(s2)){ if(s2.equals(s1)){
60 boolean b; true,false int d;,-3,-2,-1,0,1,2,3, x=3; x<5 true
61 int x = 6; b boolean b = x>5; System.out.println("b="+b); b=true if(b){ System.out.println(" "); else{ System.out.println(" "); b==true
62 && if(3<x && x<6){ x 3 x 6 if(x<5 6<x){ x 5 x 6! if(!(x<5 6<x)){ x 5 x 6
63 else if( ) { ; if(x>=1000){ x = x - 100;
64 else if if( 1){ else if( 2){ else if( 3){ else{
65 else if if(x>=10000){ x = x ; else if(x>=5000){ x = x - 400; else if(x>=3000){ x = x - 100; else if(x>=1000){ x = x - 10;
66 import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstreamreader; public class Kadai81 { public static void main(string[] args) throws IOException { BufferedReader kbd = new BufferedReader( new InputStreamReader(System.in)); System.out.println(" "); String ss = kbd.readline(); int d = Integer.parseInt(ss); if(d%2==0){ System.out.println(" "); else{ System.out.println(" ");
67
68 import java.io.ioexception; public class Reidai83 { public static void main(string[] args) throws IOException { java.io.bufferedreader kbd = new java.io.bufferedreader( new java.io.inputstreamreader(system.in)); System.out.println(" "); String ss = kbd.readline(); int d = Integer.parseInt(ss); String color=""; if(d%3==1){ color=" "; else if(d%3==2){ color=" "; else{ color=" "; System.out.println(color);
69 import java.io.ioexception; public class Reidai84 { public static void main(string[] args) throws IOException { java.io.bufferedreader kbd = new java.io.bufferedreader( new java.io.inputstreamreader(system.in)); System.out.println(" "); String ss = kbd.readline(); int d = Integer.parseInt(ss); if(d>=3000){ d *= 0.8; else if(d>=2000){ d *= 0.85; else if(d>=1000){ d *= 0.9; System.out.println(d);
70
71 import java.io.ioexception; public class Reidai85 { public static void main(string[] args) throws IOException { java.io.bufferedreader kbd = new java.io.bufferedreader( new java.io.inputstreamreader(system.in)); System.out.println(" (in,ft,yd) "); String unit = kbd.readline(); System.out.println(" "); String ss = kbd.readline(); double d = Double.parseDouble(ss); double mul=0; if(unit.equals("in")){ mul=2.54; else if(unit.equals("ft")){ mul=30.48; else if(unit.equals( yd")){ mul=91.44; else{ System.out.println("in,ft,yd "); return; System.out.println(mul*d+"cm");
72
73 double int
74
75
76 while while( ){
77 int a=3; while(a>0){ while while( ){ a System.out.println( a= +a); a--; a=3 a=2 a=1 a=a-1 a--;
78 for for( ; ; ){ o yes
79 for for( ){ while( ){ for(a=3;a>0;a--){ int a=3; while(a>0){ a--;
80 for for i for(int i=0;i<3;i++){ [ ] i<3 i=0 i=0 i++ i=1 i++ i=2 i++ i=3 i=0 i=1 i=2
81 for for i for(int i=0;i<3;i++){ System.out.println( i= +i); i<3 i=0 i=0 i++ i=1 i++ i=2 System.out. println ( i= +i); i=0 System.out. println ( i= +i); i=1 System.out. println ( i= +i); i=2 i=0 i=1 i=2
82 int dt[] = {30,50,15; int sum = 0; dt[0] for(int i=0;i<3;i++){ sum += dt[i]; System.out.println( sum= +sum); dt dt[1] dt[2] i<3 i=0 i=0 i++ i=1 i++ i=2 sum =0 0 sum i=0 sum+=dt[i]; sum =30 30 sum i=1 sum+=dt[i]; sum =80 80 sum i=2 sum+=dt[i]; sum =95 95 sum sum =95 System out printl ( sum= +sum) sum=95 +=
83 for for for(int i=1;i<=3;i++){ System.out.println( i= +i) for(int j=1;j<=2;j++){ System.out.println ( j= +j+,i+j= +(i+j))
84 =1 =1 ++ =2 ++ =3 <=3 j=1 i=1 System. out. println ( i= +i); j=1 i=2 System. out. println ( i= +i); j=1 i=3 System. out. println ( i= +i); j=1 j++ j=2 j<=2 j=1 j=2 System.out.println ( j= +j+,i+j= +(i+j)); j=1 j++ j=2 j=1 j=2 System.out.println ( j= +j+,i+j= +(i+j)); j=1 j++ j=2 j=1 System.out.println ( j= +j+,i+j= +(i+j)); i=1 j=1,i+j=2 j=2,i+j=3 i=2 j=1,i+j=3 j=2,i+j=4 j=2 i=3 j=1,i+j=4
85 import java.io.*; public class EchoTwice { public static void main(string[] args) throws IOException { String ss; BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in)); while((ss = kbd.readline())!= null){ System.out.println(ss+" "+ss); if(ss.equals("end")){ break; kbd.close();
86 while((ss = kbd.readline())!= null){ asd ss yz ss (ss = kbd.readline()) null asd asd yz yz
87 break while((ss = kbd.readline())!= null){ asd ss yz ss asd asd yz yz if(ss.equals("end")){ break;
88 break break for while for( ; ; ){ for( ; ; ){ if( ){ break; System.out.println( );
89 break LP_OUTER LP_OUTER:for( ; ; ){ for( ; ; ){ if( ){ break LP_OUTER; System.out.println( ); System.out.println( );
90 int dt[] = {5,4,12,23,7; 1. public class Reidai91 { 2. public static void main(string[] args) { 3. int dt[] = {5,4,12,23,7; 4. int max=dt[0]; 5. for(int i=1;i<dt.length;i++){ 6. if(max<dt[i]){ 7. max=dt[i]; System.out.println(" ="+max);
91 3. int dt[] = {5,4,12,23,7; 4. int max=dt[0]; 5. for(int i=1;i<dt.length;i++){ 6. if(max<dt[i]){ 7. max=dt[i]; System.out.println(" ="+max);
92 3. int dt[] = {5,4,12,23,7; 4. int max=dt[0]; 5. for(int i=1;i<dt.length;i++){ 6. if(max<dt[i]){ i=1 7. max=dt[i]; if(max<dt[i]){ 7. max=dt[i]; if(max<dt[i]){ 7. max=dt[i]; if(max<dt[i]){ 7. max=dt[i]; 8. i=2 i=3 i=4 max > < < > dt[i]
93 ##### *#### **### ***## ****# ***** 1.public class Reidai92 { 2. public static void main(string[] args) { 3. for(int i=0;i<6;i++){ 4. for(int j=0;j<i;j++){ 5. System.out.print("*"); for(int j=0;j<5-i;j++){ 8. System.out.print("#"); System.out.println("");
94 * * 3. for(int i=0;i<6;i++){ 4. for(int j=0;j<i;j++){ 5. System.out.print("*"); System.out.println(""); 11. j=0 j=1 j=2 j=3 j=4 i=3 i=0 j=0,1,2 i=1 * i=2 i=3 i=4 i=5 4. for(int j=0;j<3;j++){ 5. System.out.print("*"); 6. * * * * * * * * * * * * * * *
95 # i # 5-i i=0 i=1 ##### *#### **### ***## ****# ***** = 5-i = 5-0 = 5-i = 5-1 i=2 = 5-i = 5-2 i=3 = 5-i = 5-3 i=4 = 5-i = 5-4 i=5 = 5-i = 5-5 # 0 5-i 3. for(int i=0;i<6;i++){ 7. for(int j=0;j< 5-i ;j++){ 8. System.out.print("#"); System.out.println(""); 11.
96 1:import java.io.ioexception; 2:public class Reidai93 { 3: public static void main(string[] args) throws IOException { 4: String unit,ss; 5: java.io.bufferedreader kbd 6: = new java.io.bufferedreader( 7: new java.io.inputstreamreader(system.in)); 8: String ssout=""; 9: System.out.println(" "); 0: while((ss = kbd.readline())!=null){ 1: int d=integer.parseint(ss); 2: for(int i=0;i<d;i++){ 3: ssout+=" "; 4: 5: if(ssout.length()>10){ 6: System.out.println(" "); 7: break; 8: 9: System.out.println(ssout); 0: 1:
97 public class Reidai81 { publlc static void main(string[] args) { for(int i=0;i<=100;i++){ if((i%16==0) (i%24==0)){ System.out.println(i);
98 double dt[] = {172.3,168.5,177.8,181.5,174.8; * *** ***** ******* ***** *** *
99 abced $ java Kadai93 abc abc ed ccc abcedccc clear xyz xyz end good bye.
100
101 int[] months={31,28,31,30,31,30,31,31,30,31,30,31;
102 String[] days={" "," "," "," "," "," "," ",;
103 nt x=0 nt y=3; nt z=5; = z-y; ystem.out.println( x= +x); int x=0 int y=3; int z=5; x = z-y; System.out.println( x= +x);
104 { public class Hello{ public static void main(string args[]){ int sum = 0; for(int i=0;i<10;i++){ if((i % 2) ==0){ sum += i; System.out.println( sum= +sum);
105 { public class Hello{ public static void int sum = 0; for(int i=0;i<1 if((i % 2) sum += System.out.prin
106 { int a; { int b; { int c; { int a; int a;
107 str public class Rei102 { public static void main(string[] args) { int[] dec={1,2,3,4,5,; for(int i=0;i<dec.length;i++){ if(dec[i]%2==0){ String str=dec[i]+" "; System.out.println(str);
108 1. public class Rei102 { 2. public static void main(string[] args) { 3. int[] dec={1,2,3,4,5,; 4. for(int i=0;i<dec.length;i++){ 5. String str; 6. if(dec[i]%2==0){ 7. str=dec[i]+" "; System.out.println(str); String str=null;
109 null null while((ss = kbd.readline())!= null){ null null
110 break break for while if for while BK_1 BK_1:{ break BK_1; System.out.println( );
111 System.out.println(" "); String ss = kbd.readline(); BK_1:{ for(int i=0;i<ss.length();i++){ if(ss.charat(i)=='a'){ break BK_1; System.out.println(" "a " ");
112 for break for System.out.println( "); String ss = kbd.readline(); BK_1:{ for(int i=0;i<ss.length();i++){ if(ss.charat(i)=='a'){ break BK_1; BK_1 System.out.println( ");
113 String ss = kbd.readline(); boolean noa=true; for(int i=0;i<ss.length();i++){ if(ss.charat(i)=='a'){ noa=false; break; if(noa){ System.out.println(" "a " ");
114 double dt[] = {172.3,168.5,177.8,181.5,174.8;
115 t[3][4] dt[0] dt[1] dt[2] dt[0][0] dt[0][1] dt[0][2] dt[0][3] dt[1][0] dt[1][1] dt[1][2] dt[1][3] dt[2][0] dt[2][1] dt[2][2] dt[2][3] 8 11
116 int dt[][]; dt = new int[2][]; dt[0] = new int[3]; dt[1] = new int[3]; dt[1][1]=25; dt[][] dt[2][] dt[0] dt[1] dt[2][3] dt[0] dt[1] dt[2][3] dt[0] dt[1] dt[2][3] dt[0][0] dt[0][1] dt[0][2] dt[0][0] dt[0][1] dt[0][2] dt[1][0] dt[1][1] dt[1][2] dt[0] dt[0][0] dt[0][1] dt[0][2] 25 dt[1] dt[1][0] dt[1][1] dt[1][2]
117 int dt[][] = new int[2][]; dt[0] = new int[3]; dt[1] = new int[3]; dt[1][1] = 25; int dt[][]; dt = new int[2][3]; dt[1][1] = 25; int dt[][] = new int[2][3]; dt[1][1] = 25;
118 int dt[][] = { {10,25, 5, 5, {15, 5,12, 8, { 9, 6,15,11, ; dt[3][4] dt[0] 10 dt[0][0] 25 dt[0][1] 5 dt[0][2] 5 dt[0][3] dt[1] 15 dt[1][0] 5 dt[1][1] 12 dt[1][2] 8 dt[1][3] dt[2] 9 dt[2][0] 6 dt[2][1] 15 dt[2][2] 11 dt[2][3]
119 int dt[][] = { {10,25, {15, { 9, 6,15,11, ; dt[3][4] dt[0] dt[1] dt[2] dt[0][0] dt[0][1] 15 dt[1][0] dt[2][0] dt[2][1] dt[2][2] dt[2][3] int dt[][] = new int[3][]; int dt[0] = new int[2]; int dt[1] = new int[1]; int dt[2] = new int[4]; dt.length -> dt[0].length -> dt[1].length -> dt[2].length ->
120 String directions[][]={ "," "," ",, "," "," ",, "," "," ",, {" {" {" ; ublic class Reidai111 { public static void main(string[] args) { String directions[][]={ {" "," "," ",, {" "," "," ",, {" "," "," ",, ; for(int i=0;i<directions.length;i++){ for(int j=0;j<directions[i].length;j++){ System.out.print(directions[i][j]+" "); System.out.println("");
121 $ java Kadai112 input A,B or C : A A A A AAAAA A A
122 1:import java.io.ioexception; 2:public class Reidai1121 { 3: public static void main(string[] args) 4: throws IOException { 5: String hana[][]={ 6: { 7: " A", 8: " A A", 9: " AAAAA", 0: "A A", 1:, 2: { 3: "BBBBB", 4: "B B", 5: "BBBBB", 6: "B B", 7: "BBBBB", 8:, // C 9: ;
123 0: java.io.bufferedreader kbd 1: = new java.io.bufferedreader( 2: new java.io.inputstreamreader(system.in)); 3: System.out.println("input A, B or C:"); 4: String ss = kbd.readline(); 5: if(ss.equals("a")){ 6: for(int i=0;i<hana[0].length;i++){ 7: System.out.println(hana[0][i]); 8: 9: else if(ss.equals("b")){ 0: for(int i=0;i<hana[1].length;i++){ 1: System.out.println(hana[1][i]); 2: 3: else if(ss.equals("c")){ 4: for(int i=0;i<hana[2].length;i++){ 5: System.out.println(hana[2][i]); 6: 7: else{ 8: System.out.println( A,B,C "); 9: 0: 1:
124 hana[][] hana[0] hana[1] hana[2] A A A AAAAA A A hana[0][0] hana[0][1] hana[0][2] hana[0][3] BBBBB B B BBBBB B B BBBBB hana[1][0] hana[1][1] hana[1][2] hana[1][3] hana[1][4] CCCC C C C C C CCCC hana[2][0] hana[2][1] hana[2][2] hana[2][3] hana[2][4] : else if(ss.equals( B")){ for(int i=0;i<hana[1].length;i++){ System.out.println(hana[1][i]);
125 26: for(int i=0;i<hana[0].length;i++){ 27: System.out.println(hana[0][i]); 28: 30: for(int i=0;i<hana[1].length;i++){ 31: System.out.println(hana[1][i]); 32: 34: for(int i=0;i<hana[2].length;i++){ 35: System.out.println(hana[2][i]); 36:
126 1:import java.io.ioexception; 2:public class Reidai1121 { 3: public static void main(string[] args) 4: throws IOException { 5: String hana[][]={ // 6: ; 7: java.io.bufferedreader kbd 8: = new java.io.bufferedreader( 9: new java.io.inputstreamreader(system.in)); 0: System.out.println("input A, B or C:"); 1: String ss = kbd.readline(); 2: int ichar=0; 3: if(ss.equals("a")){ 4: ichar=0; 5: else if(ss.equals("b")){ 6: ichar=1; 7: else if(ss.equals("c")){ 8: ichar=2; 9: else{ 0: System.out.println( A,B,C "); 1: return; 2: 3: for(int i=0;i<hana[ichar].length;i++){ 4: System.out.println(hana[ichar][i]); 5: 6: 7:
127 ichar 12: int ichar=0; 13: if(ss.equals("a")){ 14: ichar=0; 15: else if(ss.equals("b")){ 16: ichar=1; 17: else if(ss.equals("c")){ 18: ichar=2; 19: else{ 20: System.out.println( A,B,C "); 21: return; 22: ichar na[3][5] hana[1] BBBBB B B BBBBB B B BBBBB hana[1][0] hana[1][1] hana[1][2] hana[1][3] hana[1][3] 3: for(int i=0;i<hana[ichar].length;i++){ 4: System.out.println(hana[ichar][i]); 5: ichar
128 if(ss.equals("a")){ ichar=0; else if(ss.equals("b")){ ichar=1; else if(ss.equals("c")){ ichar=2; else if(ss.equals( D")){ ichar=3; else if(ss.equals( E")){ ichar=4; :( ) else if(ss.equals( Z")){ ichar=26; else{ :
129 1:import java.io.ioexception; 2:public class Reidai1121 { 3: public static void main(string[] args) 4: throws IOException { 5: String hana[][]={ // 6: ; 7: String[] index={"a","b","c",; 8: java.io.bufferedreader kbd 9: = new java.io.bufferedreader( 0: new java.io.inputstreamreader(system.in)); 1: System.out.println("input A, B or C:"); 2: String ss = kbd.readline(); 3: int ichar=-1; 4: for(int i=0;i<hana.length;i++){ 5: if(ss.equals(index[i])){ 6: ichar=i; 7: break; 8: 9: 0: if(ichar==-1){ 1: System.out.println( A,B,C "); 2: return; 3: 4: for(int i=0;i<hana[ichar].length;i++){ 5: System.out.println(hana[ichar][i]); 6: 7:
130 7: String[] index={"a","b","c",; 2: String ss = kbd.readline(); 4: for(int i=0;i<hana.length;i++){ 15: if(ss.equals(index[i])){ i=0 16: ichar=i; 17: break; 18: 15: if(ss.equals(index[i])){ i=1 16: ichar=i; 17: break; 18: 9: 4: //ichar=1 index[i] A ss B == B B == B
131 int dt[][] = { {10,25, 5, 5, {15, 5,12, 8, { 9, 6,15,11, ;
132 char yama0[][]={ { *, *, { *, *, { *, *, *, *, { *, *, *, { *, *, *, *, ; char yama1[][]={ { *, *, *, *, *, { *, *, *, { *, *, { *, *, *, *, { *, *, ;
133 public static void main(string args[]) public class Hello{ public static void main(string args[]){ System.out.println("Hello, world.");
134
135 ublic class PrintLines { public static void main(string[] args) { repeatstr("xy",3); repeatstr("yz",2); repeatstr("z ",3); public static void repeatstr(string s, int n){ for(int i=0;i<n;i++){ System.out.print(s); System.out.println(""); xyxyxy yzyz z z z
136 // repeatstr("xy",3); // public static void repeatstr(string s, int n){ // void public static
137 public static void main(string[] args) { repeatstr("xy",3); repeatstr("yz",2); repeatstr("z ",3); public static void repeatstr(string s, int n){ s= xy ; s= yz ; s= z ; n=3; n=2; n=3; for(int i=0;i<n;i++){ System.out.print(s); System.out.println(""); xyxyxy yzyz
138 public class FactorEx { public static void main(string[] args) { int x = calfactor(4); System.out.println(x); x = calfactor(5); System.out.println(x); int public static int calfactor(int a){ int fac = 1; for(int i=1;i<=a;i++){ fac *= i; return fac;
139
140 void return public static void repeatstr(string s, int n){ // return;
141 public class PrintLines { public static void main(string[] args) { for(int i=0;i<3;i++){ System.out.print( xy ); System.out.println(""); for(int i=0;i<2;i++){ System.out.print( yz ); System.out.println(""); for(int i=0;i<3;i++){ System.out.print( z ); System.out.println("");
142 public class RepeatStr { public static void main(string[] args){ String str = args[0]; int n = Integer.parseInt(args[1]); for(int i=0;i<n;i++){ System.out.println(str);
143 args[] args[] main(string args[]){ String str = args[0]; int n = Integer.parseInt(args[1]); args[] args.length
144
145 **### ***## ****# ***** pulic static void drawsyms(int w, String s) public class Reidai121 { public static void main(string[] args) { for(int i=0;i<6;i++){ drawsyms(i,"#"); drawsyms(5-i,"*"); System.out.println(""); ##### *#### private static void drawsyms(int w,string s){ for(int i=0;i<w;i++){ System.out.print(s);
146
147 ublic class Reidai121 { public static void main(string[] args) { int d = Integer.parseInt(args[0]); for(int i=0;i<d+1;i++){ drawsyms(i,"#"); drawsyms(d-i,"*"); System.out.println(""); private static void drawsyms(int w,string s){ for(int i=0;i<w;i++){ System.out.print(s);
148 ****#**** ***###*** **#####** *#######* **#####** ***###*** ****#****
149 $ java Kadai123 & = ====&==== ===&&&=== ==&&&&&== =&&&&&&&= ==&&&&&== ===&&&=== ====&====
150
151 abcd str equals(string) ss abc if(ss.equals( abc )){ s1 s2 if(s1.equals(s2)){ if(s2.equals(s1)){
152 charat() String str = akira ; char c = str.charat(2); // c i i c a k i r a length() String str = akira ; int n = str.length(); // n n 5 akira str akira str
153 substring(int) String str = ; String s1 = str.substring(4); // s s str substring(int,int) String str = ; String s1 = str.substring(4,6); // s s str
154 indexof(string) String str = 0123ab6 ; int n = str.indexof( ab ); // n int n = str.indexof( cd ); // n -1 replace(char,char) n ab6 str String str = katakata ; String s1 = str.replace( a, o ); // s1 kotokoto kotokoto s1 katakata str
155
156 true if(character.isdigit(ch)){ //ch 4 ch false j ch if(character.isletter(ch)){... //ch if(character.isuppercase(ch)){... //ch if(character.iswhilespace(ch)){... //ch har cha = a ; char chb = B ; har cha2 = Character.toUpperCase(cha); har chb2 = Character.toLowerCase(chb); / cha2 A chb2 b A cha2 a cha
157 d ss d = Integer.parseInt(ss); f = Double.parseDouble(ss);
158 d=integer.parseint(s); String) s= +d; 212 s d=character.digit(c,10); (char) (int) d 10 f=d; d=(int)f; (double) f=double.parsedouble(s); s= +f; s= +c; c=s.charat(0); c=character.fordigit(d,10); 3.14 f 4 c
159 $ java Kadai131 input string : I refused him absolutely. a:1, i:0, u:2, e:3, o:1
160 char vowel[] = { a, i, u, e, o ; int counter[] = {0,0,0,0,0; $ java Kadai134 input string : 23fjaksi55f 8989da
161
162
163
164 java CatFile test.txt aaaaa bbbbb cccc
165 import java.io.*; public class CatFile { public static void main(string[] args) throws IOException { String filename = args[0]; String ss; BufferedReader fin = new BufferedReader( new FileReader(fileName)); while((ss = fin.readline())!=null){ System.out.println(ss); fin.close();
166 fin fin BufferedReader fin = new BufferedReader( new FileReader(fileName)); BufferedReader FileReader
167 fin ss ss = fin.readline() fin.readline() String ss1,ss2; BufferedReader fin = new BufferedReader(new FileReader(fileName)); ss1 = fin.readline(); ss1 = fin.readline();
168 while((ss = fin.readline())!= null){ aaaaa ss aaaaa bbbbb ss bbbbb cccc ss cccc (ss = fin.readline()) null
169 fin : // fin.close(); fin fin fin
170 String ss; BufferedReader fin = new BufferedReader(new FileReader(fileName)); ss = fin.readline(); ss = new String(ss.getBytes("iso "),"JISAutoDetect");
171 A 12 B 28 C 20 $ java Kadai142 test.txt A ************ B **************************** C ********************
172 Abc Abc def def ghi ghijk $ java Kadai143 test1.txt test2.txt Abc def
173
174
175 #java WriteFile #cat test1.txt test1.txt abcdefg 3.14
176 mport java.io.*; ublic class WriteFile { public static void main(string[] args) throws IOException { PrintWriter fout = new PrintWriter( new BufferedWriter( new FileWriter("test15.txt"))); fout.println("abcdefg"); fout.println(" "+3.14); fout.close();
177 fout PrintWriter fout = new PrintWriter( new BufferedWriter( new FileWriter("test1.txt"))); fout fout PrintWriter BufferedWriter FileWriter Test1.txt
178 fout fout.println( abcdefg ); Test1.txt abcdefg fout PrintWriter
179 $ java Kadai152 input file name: test152.txt input lines:. test.152.txt
180 $ java Kadai153 test1.txt test2.txt Abc 1234 Abc1234 def 5678 def5678 ghi910 ghi 910
181 Abc 1234 Abc def dEf 5678ghi910 ghi 910
182 int i=4; aa[i]=3; aa[0] aa[1] aa[2] public final class DspInqueriesAction extends Action{ protected static Logger logger = Logger.getLogger(LoggingPlugIn.class.getName()); public ActionForward execute(actionmapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response){ String inqueriesdirectory = this.servlet.getinitparameter("inquery-directory")+"inqueries/"; logger.fine("(1)inqueriesdirectory="+inqueriesdirectory); ActionErrors errors = FileAccess.setInqueryListFromFile(inqueriesDirectory,inqueryList); if(errors.size()!=0){ saveerrors(request,errors); return map.findforward("fault"); request.setattribute("inquery.list",inquerylist.toarray()); return map.findforward("success"); aa
183 try{ // // catch(exception e){ // // public static void xx() // throws Exception{ xx(); // // (throws)
184 import java.io.*; public class Input { public static void main(string[] args) { : ss = kbd.readline(); : eclipse Input.java:21: java.io.ioexception ss = kbd.readline(); ^
185 port java.io.*; blic class CatFile { public static void main(string[] args){ String filename = args[0]; String ss; BufferedReader fin = null; try{ fin = new BufferedReader(new FileReader(fileName)); while((ss = fin.readline())!=null){ System.out.println(ss); fin.close(); catch(exception e){ System.out.println(" ("+filename + ) ); System.out.println("e="+e);
186 java CatFile test2.txt try{ catch{ import java.io.*; public class CatFile { public static void main(string[] args){ String filename = args[0]; String ss; BufferedReader fin = null; try{ fin = new BufferedReader(new FileReader(fileName)); while((ss = fin.readline())!=null){ System.out.println(ss); fin.close(); catch(exception e){ System.out.println(" ("+filename + ) ); System.out.println("e="+e);
187 Exception e catch(exception e){ : System.out.println("e="+e); e System.out.println("e="+e); e
188 e.printstacktrace(); e
189 import java.io.*; public class CatFile2 { public static void main(string[] args) { String filename = args[0]; try { fileaccess(filename); catch (Exception e) { System.out.println(" ("+filename +") "); System.out.println("e="+e); public static void fileaccess(string filename) throws Exception { BufferedReader fin; fin = new BufferedReader(new FileReader(fileName)); String ss; while((ss = fin.readline())!=null){ System.out.println(ss); fin.close();
190 fileaccess public static void main(string[] args) { : try { // // // // try fileaccess(filename); catch (Exception e) { // // catch public static void fileaccess (String filename) throws Exception { // //
191 Exception ClassNotFoundException IOException FileNotFoundException ObjectStreamException EOFException
192 try { : catch (FileNotFoundException e) { // System.out.println(" ("+filename +") "); catch (IOException e) { // FileNotFoundException // System.out.println(" ("+filename +") "); Exception
193
194 NumberFormatException d 2SB ss ss = kbd.readline(); d = Integer.parseInt(ss); kbd.readline() NumberFormatException
195
196 String flist[].project ListFiles.class ListFiles.java flist[0] flist[1] flist[2]
197 import java.io.file; public class ListFiles { public static void main(string[] args) { try{ File dir = new File("."); String flist[] = dir.list(); if(flist==null){ System.out.println(" "); return ; for(int i=0;i<flist.length;i++){ System.out.println(flist[i]); catch(exception e){ System.out.println(" e="+e); $ java ListFiles.project ListFiles.class ListFiles.java
198 File dir = new File("."); dir String flist[] = dir.list(); String flist[].project ListFiles ListFil.class es flist[0] flist[1] flist[2].java dir
199 $ java Kadai172 C: eclipse abc abcedf.txt abcok.java
200 String flist[] flist[0] flist[1] example flist[2] for(int i=0;i<flist.length;i++){ a b if((new File(. +flist[i])).isfile()){ // System.out.println(flist[i]);
K227 Java 2
1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html
More informationJava Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225
Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1
More informationデータ構造とアルゴリズム論
15 10 14 Java jtextfielddata jbuttonwrite jlabelmessage void jbuttonwrite_actionperformed(actionevent e) { String Data=jTextFieldData.getText(); try { // Test1.txt fw FileWriter fw= new FileWriter("Test1.txt");
More informationJava (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1
Java (9) 1 Lesson 7 2008-05-20 Java System.out.println() 1 Java API 1 Java Java 1 GUI 2 Java 3 1.1 5 3 1.0 10.0, 1.0, 0.5 5.0, 3.0, 0.3 4.0, 1.0, 0.6 1 2 4 3, ( 2 3 2 1.2 Java (stream) 4 1 a 5 (End of
More informationII 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C JavaScript Web CGI HTML 1.2 Servlet Java
II 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI Java Java JVM Java CGI
More information$ java StoreString abc abc ed abced twice abcedabced clear xyz xyz xyz bingo! abc bingo!abc ^Z mport java.io.*; ublic class StoreString { public static void main(string[] args) throws IOException{ BufferedReader
More informationWeb 1 p.2 1 Servlet Servlet Web Web Web Apache Web Servlet JSP Web Apache Tomcat Jetty Apache Tomcat, Jetty Java JDK, Eclipse
Web 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C Java Applet JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI 1 Java Java
More informationr1.dvi
2006 1 2006.10.6 ( 2 ( ) 1 2 1.5 3 ( ) Ruby Java Java Java ( Web Web http://lecture.ecc.u-tokyo.ac.jp/~kuno/is06/ / ( / @@@ ( 3 ) @@@ : ( ) @@@ (Q&A) ( ) 1 http://www.sodan.ecc.u-tokyo.ac.jp/cgi-bin/qbbs/view.cgi
More information新・明解Java入門
537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,
More informationデータ構造とアルゴリズム論
Java jtextfielddata jbuttonwrite jlabelmessage void jbuttonwrite_actionperformed(actionevent e) { String Data=jTextFieldData.getText(); try { // Test1.txt fw FileWriter fw= new FileWriter("Test1.txt");
More informationHTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f
1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway InterfaceWeb HTML Web Web CGI CGI CGI Perl C Java Applet JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI 1 Java / Java Java CGI Servlet
More informationJava学習教材
Java 2016/4/17 Java 1 Java1 : 280 : (2010/1/29) ISBN-10: 4798120987 ISBN-13: 978-4798120980 2010/1/29 1 Java 1 Java Java Java class FirstExample { public static void main(string[] args) { System.out.println("
More informationHTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f
1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway InterfaceWeb HTML Web Web CGI CGI CGI Perl C Java Applet JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI 1 Java / Java Java CGI Servlet
More information2
問題 次の設問に答えよ 設問. Java のソースコードをコンパイルするコマンドはどれか a) java b) javac c) javadoc d) javaw 設問. Java のバイトコード ( コンパイル結果 ) を実行するコマンドはどれか a) java b) javac c) javadoc d).jar 設問. Java のソースコードの拡張子はどれか a).c b).java c).class
More information解きながら学ぶJava入門編
44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean
More informationJavaセキュアコーディングセミナー東京 第3回 入出力(File, Stream)と例外時の動作 演習解説
Java セキュアコーディングセミナー東京第 3 回入出力と例外時の動作 演習解説 2012 年 11 月 11 日 ( 日 ) JPCERT コーディネーションセンター脆弱性解析チーム戸田洋三 1 Hands-on Exercises コンパイルエラーに対処しよう ファイルからのデータ入力を実装しよう 2 Hands-on Exercise(1) サンプルコードの コンパイルエラーに対処しよう 3
More information2
問題 1 次の設問 1~5 に答えよ 設問 1. Java のソースプログラムをコンパイルするコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 2. Java のバイトコード ( コンパイル結果 ) を実行するコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 3. Java のソースプログラムの拡張子はどれか a).c
More informationJava プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の break; まで処理しますどれにも一致致しない場合 def
Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の まで処理しますどれにも一致致しない場合 default: から直後の まで処理します 式の結果 ラベル 定数 整数または文字 (byte, short, int,
More informationI java A
I java 065762A 19.6.22 19.6.22 19.6.22 1 1 Level 1 3 1.1 Kouza....................................... 3 1.2 Kouza....................................... 4 1.3..........................................
More informationJava プログラミング Ⅰ 7 回目 switch 文と論理演算子 条件判断文 3 switch 文 switch 文式が case の値と一致した場合 そこから直後の break; までを処理し どれにも一致しない場合 default; から直後の break; までを処理する 但し 式や値 1
Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 条件判断文 3 switch 文 switch 文式が case の値と一致した場合 そこから直後の までを処理し どれにも一致しない場合 default; から直後の までを処理する 但し 式や値 1 値 2は整数または文字である switch( 式 ) case 値 1: // コロン : です セミコロン ; と間違えないように!!
More informationMicrosoft PowerPoint - prog13.ppt
プログラミング言語 3 第 13 回 (2008 年 01 月 07 日 ) 1 今日の配布物 片面の用紙 1 枚 今日の課題が書かれています 本日の出欠を兼ねています 2/57 今日やること http://www.tnlab.ice.uec.ac.jp/~s-okubo/class/java06/ にアクセスすると 教材があります 2008 年 01 月 07 日分と書いてある部分が 本日の教材です
More informationMicrosoft PowerPoint - prog13.ppt
プログラミング言語 3 第 13 回 (2008 年 01 月 07 日 ) 1 今日の配布物 片面の用紙 1 枚 今日の課題が書かれています 本日の出欠を兼ねています 2/57 1 今日やること http://www.tnlab.ice.uec.ac.jp/~s-okubo/class/java06/ にアクセスすると 教材があります 2008 年 01 月 07 日分と書いてある部分が 本日の教材です
More informationオブジェクト指向プログラミング・同演習 5月21日演習課題
オブジェクト指向プログラミング 同演習 5 月 21 日演習課題 問題 1 配列の例外処理例外が発生する可能性のある処理を try で囲み その後に catch で例外を捕捉します 例外処理の終了処理として finally が行われます これは書かなくて自動的に行われます 提出課題 1 (Kadai052301.java) 以下のプログラムは例外処理をしていない ArrayIndexOutOfBoundsException
More information3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");
(Basic Theory of Information Processing) Java (eclipse ) Hello World! eclipse Java 1 3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello
More informationJavaプログラミングⅠ
Java プログラミング Ⅰ 3 回目変数 今日の講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能です 変数は 型 ( データ型ともいいます ) と識別子をもちます 2 型 変数に記憶できる値の種類です型は 値の種類に応じて次の 8 種類があり これを基本型といいます 基本型値の種類値の範囲または例 boolean 真偽値 true または
More informationJava プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲
Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲を決定します 次の型が利用でき これらの型は特に基本型とよばれます 基本型 値の種類 値の範囲 boolean
More informationProgramming-C-9.key
プログラミングC 第9回 例外 スレッド 白石路雄 2 finally try{ ( 例外が発生するかもしれない処理 ) catch(exception のクラス名 e){ ( 例外が発生した時の処理 ) finally{ ( 例外の発生の有無に関わらず 必ず行う処理 ) 3 Integer.parseInt() NumberFormatException
More informationプログラミングA
プログラミング A 第 10 回 演習 2015 年 6 月 29 日 東邦大学金岡晃 本日の内容 中間テストの解説 演習 1 2015/6/29 プログラミング A 中間テスト解説 : 問 1 < 問 1> 下記の命令が実行された後の a の値を書きなさい ( 省略 ). int a=13; 答え : 13 2 中間テスト解説 : 問 2 < 問 2> 下記の命令が実行された後の a の値を書きなさい
More informationJavaプログラミングⅠ
Java プログラミング Ⅱ 10 回目への出力 ストリーム ストリームとは入力または出力の流れをもつデータの連鎖ですストリームは異なる機器からのデータを統一的に扱う考え方です 文字ストリーム 文字ベースの入出力をサポートします - Unicode(Java 内部 ) とローカルコード (Java 外部 ) の変換が行われ プログラマはその違いを意識しなくてすみます バイトストリームバイナリデータの入出力をサポートします
More informationJava プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文
Java プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文字 0x0000 ~ 0xffff byte 1バイト整数 - 2 8 ~ 2 8-1 short 2バイト整数
More informationohp02.dvi
172 2017.7.16 1 ? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X 2 ( ) 3 2-0 ( ) ( ) ( ) (12) ( ) (112) 31) 281 26 1 4 (syntax) (semantics) ( ) 5 BNF BNF(Backus Normal Form) Joun Backus (grammer) English grammer
More information明解Java入門編
1 Fig.1-1 4 Fig.1-1 1-1 1 Table 1-1 Ease of Development 1-1 Table 1-1 Java Development Kit 1 Java List 1-1 List 1-1 Chap01/Hello.java // class Hello { Java System.out.println("Java"); System.out.println("");
More informationProg1_11th
2018 年 6 月 28 日 ( 木 ) 実施 ファイル操作とディレクトリ操作今回の授業では,Java 言語でのファイル操作とディレクトリ操作とについて学習する ファイル操作ファイル (File) とは, データの集合体のことで,JIS( 日本工業規格 ) では, ファイルはレコードの集合体, レコードはデータの集合体と定義されている ファイル操作は, 次の順序で行う なお, ストリームとは, 入力元または出力先を持つ,
More informationII 2 p.2 2 GET POST form action URL Aisatsu 2.1 Servlet GET GET : Query String QueryStringTest.java 1 import java.io.ioexception; 2 import java.io.pri
II 2 p.1 2 GET POST Servlet Servlet Servlet CGI/Servlet GET POST 2 GET URL? FORM GET : http://maps.google.co.jp/maps?hl=ja&ll=34.292821,134.063587&z=15 POST HTML HTML : Aisatsu.html HTML 1
More informationr02.dvi
172 2017.7.16 1 1.1? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X ( ) 1.2 1 2-0 ( ) ( ) ( ) (12) ( ) (112) (131) 281 26 1 (syntax) (semantics) ( ) 2 2.1 BNF BNF(Backus Normal Form) Joun Backus (grammer) English
More informationやさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF
pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) 3 5 14 18 21 23 23 24 28 29 29 31 32 34 35 35 36 38 40 44 44 45 46 49 49 50 pref : 2004/6/5 (11:8) 50 51 52 54 55 56 57 58 59 60 61
More information1/8 ページ Java 基礎文法最速マスター Java Javaの文法一覧です 他の言語をある程度知っている人はこれを読めばJavaの基礎をマスターしてJavaを書くことができるようになっています 簡易リファレンスとしても利用できると思いますので これは足りないと思うものがあれば教えてください 1. 基礎 class の作成プログラムはclassに記述します たとえばSampleという名前のclassを作る場合
More informationbreak 文 switch ブロック内の実行中の処理を強制的に終了し ブロックから抜けます switch(i) 強制終了 ソースコード例ソースファイル名 :Sample7_1.java // 入力値の判定 import java.io.*; class Sample7_1 public stati
Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の まで処理しますどれにも一致しない場合 default: から直後の まで処理します 式は byte, short, int, char 型 ( 文字または整数 ) を演算結果としますラベルには整数リテラル
More informationJavaプログラミングⅠ
Java プログラミング Ⅰ 3 回目変数 今日の講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能です 変数は 型 ( データ型ともいいます ) と識別子をもちます 2 型 変数に記憶できる値の種類です型は 値の種類に応じて次の 8 種類があり これを基本型といいます 基本型値の種類値の範囲または例 boolean 真偽値 true または
More informationJAVA 11.4 PrintWriter 11.5
JAVA 11.4 PrintWriter 11.5 PrintWriter Writer Int, float, char Object print() println() tostring() PrintWriter PrintWriter(OutputStream outputstream) PrintWriter(OutputStream outputstream, boolean flushonnewline)
More informationプログラミング入門1
プログラミング入門 1 第 6 回 Switch 文 プロジェクトの持ち運び 授業開始前に ログオン後 不要なファイルを削除し て待機してください Java 1 第 6 回 2 前回のテーマ while 文を用いた繰り返し実行 for 文との使い分け 複雑な条件判定 && かつ または を使って Java 1 第 6 回 3 復習 : while 文はfor 文から 初期化式 を外に出し ステップを進める式
More informationPowerPoint プレゼンテーション
32786~32767 2147483648~2147483647 9223372036854775808~9223372036854775807 ±10 38 ~10 38 ±10 308 ~10 308 public static void main(string[] args) { int a; double b; String s; a = 42; b = 3.1415926535; s =
More information問題1 以下に示すプログラムは、次の処理をするプログラムである
問題 1 次に示すプログラムは 配列 a の値を乱数で設定し 配列 a の値が 333 より大きく 667 以下の値 の合計値を求めるプログラムである 1 と 2 に適切なコードを記述してプログラムを完 成させよ class TotalNumber { public static void main(string[] args) { int[] a = new int[1000]; // 1 解答条件
More informationプログラミング入門1
プログラミング入門 1 第 5 回 繰り返し (while ループ ) 授業開始前に ログオン後 不要なファイルを削除し て待機してください Java 1 第 5 回 2 参考書について 参考書は自分にあったものをぜひ手元において自習してください 授業の WEB 教材は勉強の入り口へみなさんを案内するのが目的でつくられている これで十分という訳ではない 第 1 回に紹介した本以外にも良書がたくさんある
More information1 Java Java GUI , 2 2 jlabel1 jlabel2 jlabel3 jtextfield1 jtextfield2 jtextfield3 jbutton1 jtextfield1 jtextfield2 jtextfield3
1 2 2 1 2 2.1.................................................... 2 2.2.................................................... 2 2.3........................................ 2 2.4....................................................
More informationJava updated
Java 2003.07.14 updated 3 1 Java 5 1.1 Java................................. 5 1.2 Java..................................... 5 1.3 Java................................ 6 1.3.1 Java.......................
More information10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV
tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20
More information8 if switch for while do while 2
(Basic Theory of Information Processing) ( ) if for while break continue 1 8 if switch for while do while 2 8.1 if (p.52) 8.1.1 if 1 if ( ) 2; 3 1 true 2 3 false 2 3 3 8.1.2 if-else (p.54) if ( ) 1; else
More information明解Javaによるアルゴリズムとデータ構造
21 algorithm List 1-1 a, b, c max Scanner Column 1-1 List 1-1 // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); Chap01/Max3.java
More information10/8 Finder,, 1 1. Finder MAC OS X 2. ( ) MAC OS X Java ( ) 3. MAC OS X Java ( ) / 10
10/8 2015-10-08 URL : http://webct.kyushu-u.ac.jp, 10/8 1 / 10 10/8 Finder,, 1 1. Finder MAC OS X 2. ( ) MAC OS X Java ( ) 3. MAC OS X Java ( ) 1. 30 2 / 10 10/8 Finder 1 Figure : : Apple.com 2, 3 / 10
More informationデジタル表現論・第6回
デジタル表現論 第 6 回 劉雪峰 ( リュウシュウフォン ) 2016 年 5 月 16 日 劉 雪峰 ( リュウシュウフォン ) デジタル表現論 第 6 回 2016 年 5 月 16 日 1 / 16 本日の目標 Java プログラミングの基礎配列 ( 復習 関数の値を配列に格納する ) 文字列ファイルの書き込み 劉 雪峰 ( リュウシュウフォン ) デジタル表現論 第 6 回 2016 年
More informationプログラミング入門1
プログラミング入門 1 第 4 回 繰り返し (for ループ ) 授業開始前に ログオンして待機して ください Java 1 第 4 回 2 不要ファイルの掃除 前回デスクトップにファイルをダウンロードした場合 次のものを削除してください week03.zip デスクトップにファイルを置きすぎると コンピュータをシャットダウンできなくなります Java 1 第 4 回 3 授業を始めます 前回の課題は
More information例外処理とファイル入出力
例外処理と ファイル入出力 情報システム学科 平塚聖敏 例外処理とは プログラムの実行中に発生した問題を通知するために 実行時に生成される 例外の例 オブジェクト スタックオーバーフロー メモリ不足 配列の要素数を超えて参照しようとしたりする 例外処理の手順その 1 基本の例外処理 1. try ブロックで処理を囲む try{ // 処理 2. catch ブロックで例外を捕捉 catch ( 例外オブジェクトパラメータ
More informationtext_11.dvi
C 11 12 6 25 11 Java (6) ( ) 1 11.1 11 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 11.2 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
More informationJava演習(4) -- 変数と型 --
50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends
More information2016 年度 JAVA 講座第六週目 目次 パッケージ... 2 パッケージの作成... 2 パッケージの使用方法... 3 異なるパッケージ同名クラスの宣言... 4 パッケージの側面から見たアクセス修飾子... 4 ラッパークラス... 5 ラッパークラス利用法:キャスト... 5 ラッパーク
2016 年度 JAVA 講座第六週目 目次 パッケージ... 2 パッケージの作成... 2 パッケージの使用方法... 3 異なるパッケージ同名クラスの宣言... 4 パッケージの側面から見たアクセス修飾子... 4 ラッパークラス... 5 ラッパークラス利用法:キャスト... 5 ラッパークラス利用法:ArrayList... 5 例外:Exception... 6 ぬるぽ... 6 例外処理:try-catch-finaly...
More informationJavaプログラミングⅠ
Java プログラミング Ⅰ 6 回目 if 文と if else 文 今日の講義で学ぶ内容 関係演算子 if 文と if~else 文 if 文の入れ子 関係演算子 関係演算子 ==,!=, >, >=,
More informationQuick Sort 計算機アルゴリズム特論 :2017 年度 只木進一
Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一 2 基本的考え方 リスト ( あるいは配列 )SS の中の ある要素 xx(pivot) を選択 xx より小さい要素からなる部分リスト SS 1 xx より大きい要素からなる部分リスト SS 2 xx は SS 1 または SS 2 に含まれる 長さが 1 になるまで繰り返す pivot xx の選び方として 中央の要素を選択すると効率が良い
More informationhttp://www.impressjapan.jp/ Copyright 2014 Socius Japan, Inc. All rights reserved. Java SE 7 Java SE 7 OCJ-P Bronze SE 7 Java Java SE 7 Bronze OCJ-P Silver SE 7 Java Java SE 7 Programmer I OCJ-P Gold
More information問 次の Fortran プログラムの説明及びプログラムを読んで、設問に答えよ。
ソフトウェア基礎演習課題 文法理解度確認範囲 問題 1 データ型 ( 変数, データ型 ) 問題 2 制御構造 (switch 文 ) 問題 3 制御構造 (while 文 ) 問題 4 制御構造と配列 ( 総和 ) 問題 5 制御構造と配列 ( 総和, 平均 ) 問題 6 データ型と各種演算子 ( 文字列, 検索 ) 問題 7 クラスの定義 ( メソッドの定義, コンストラクタの定義, キャスト
More information55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a
55 7 Java C Java TCP/IP TCP/IP 7.1 7.1.1 TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] argv) { Socket readsocket = new Socket(argv[0], Integer.parseInt(argv[1]));
More informationAssignment_.java 課題 : 転置行列 / class Assignment_ public static void main(string[] args) int i,j; int[][] array = 1,,,,,,,,,,,,,1,1,; 行 列行列 i
1 1 0 1 Assignment_1.java 課題 1: チェッカー / class Assignment_1 public static void main(string[] args) int i,j; チェッカー用の 次元配列 int[][] checker=new int[][]; チェッカーパターンを書き込む for(i=0;i
More information2
次の課題 1~7 の を埋めてプログラムを完成させよ 1. 整数型の配列に格納されたデータの総和を計算し, その結果を出力するプログラムである このプログラムの処理手順を次に示す 1 配列の格納するデータの個数 n (n>0) を入力する 2n の大きさで配列を確保する 3 配列に n 個分のデータを格納する 4 配列の総和を求める 5 総和を出力する import java.io.*; public
More informationプログラミング入門1
プログラミング入門 1 第 3 回 条件分岐 授業開始前に ログオンして待機して ください Java 1 第 3 回 2 不要ファイルの掃除 前回デスクトップにファイルをダウンロードした場合 次のものを削除してください week02.zip デスクトップにファイルを置きすぎると コンピュータをシャットダウンできなくなります Java 1 第 3 回 3 授業を始めます 前回の課題は うまくできましたか?
More information1.ppt
/* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)
More informationuntitled
2011 7 21 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2011/index.html tech.ac.jp/k1sakai/lecture/alg/2011/index.html html 1 5 2 3 4 - 5 .. 6 - 7 public class KnapsackBB
More informationJava演習(2) -- 簡単なプログラム --
Java public class Hello Hello (class) (field)... (method)... Java main Hello World(Hello.java) public class Hello { public static void main(string[ ] args) { public() (package) Hello World(Hello.java)
More information22 200702894 1 1 3 2 4 2.1..................................... 4 2.1.1............................. 4 2.1.2............................. 4 2.2................................... 9 2.2.1...................................
More informationプログラムの基本構成
Java 入門 この 2 回 ( 今回と次回 ) が勝負だ! プログラムは自転車の練習と同じだ! 今日の予定先ず プログラムの構造を学び (p.2~6) jcpad でプログラム ( 計算機実習室 ) 戻ってきてプログラムの解読手書きプログラムを TA にみてもらい OK の出た人は計算機実習室でプログラム作成し実行実行結果を TA がチェックして帰り プログラムの基本構成 Step1: 入力 Step2:
More informationできるプログラマーを本気で育てる Java 超 Webプログラマーへの第 歩 第 3 回コレクションと例外処理 テクノロジックアート 瀬嘉秀
できるプログラマーを本気で育てる Java 超 Webプログラマーへの第 歩 第 3 回コレクションと例外処理 テクノロジックアート 瀬嘉秀 内容 コレクションとは 例外処理 Java 言語とオブジェクト指向 属性と振る舞い クラスとメソッド オブジェクト指向の特徴 演習問題 勉強会の参考書 Java ( アジャイルソフトウェア開発技術シリーズ 基礎編 ) 発売日 2012 年 5 月 10 日 著作
More information問 次の Fortran プログラムの説明及びプログラムを読んで、設問に答えよ。
解答例 問題 1 変数 a が 3 以上でかつ 7 以下の場合 true と表示し そうでない場合は false と表示するプログラムである public class Prog061004_01 { int a; boolean b; a = Integer.parseInt(buf.readLine()); b = (a >= 3) && (a
More information新・明解Java入門
第 1 章 画面 文字 表示 Java Java Java Java Java JRE Java JDK 21 1-1 Java Java Java Java 誕生 Fig.1-1 Oak Java Sun Microsystems 2010 Oracle Java Oracle 4 Java http://www.java.com/ http://www.alice.org/ Fig.1-1Java
More informationALG2012-F.ppt
2012 7 26 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 5 2 3 4 - 5 .. 6 - 7 public class KnapsackBB { // 0-1 private static double maxsofar; private
More informationIE6 2 BMI chapter1 Java 6 chapter2 Java 7 chapter3 for if 8 chapter4 : BMI 9 chapter5 Java GUI 10 chapter6 11 chapter7 BMI 12 chap
1-1 1-2 IE6 2 BMI 3-1 3-2 4 5 chapter1 Java 6 chapter2 Java 7 chapter3 for if 8 chapter4 : BMI 9 chapter5 Java GUI 10 chapter6 11 chapter7 BMI 12 chapter8 : 13-1 13-2 14 15 PersonTest.java KazuateGame.java
More information(Java/FX ) Java CD Java version Java VC++ Python Ruby Java Java Eclipse Java Java 3 Java for Everyone 2 10 Java Midi Java JavaFX Shape Canvas C
(Java/FX ) Java CD Java version 10.0.1 Java VC++ Python Ruby Java Java Eclipse Java Java 3 Java for Everyone 2 10 Java Midi Java JavaFX Shape Canvas Canvas Eclipse Eclipse M... 1 javafx e(fx)clipse 3.0.0
More information試験問題に記載されている会社名又は製品名は, それぞれ各社の商標又は登録商標です なお, 試験問題では, 及び TM を明記していません
サンプル問題 Java TM プログラミング能力認定試験 2 級 解答時における注意事項 1. 次の表に従って解答してください 問題番号問 1~ 問 7 選択方法 試験時間 7 問必須 90 分 2.HB の黒鉛筆を使用してください 訂正の場合は, あとが残らないように消しゴムできれいに消し, 消しくずを残さないでください 3. 解答用紙の所定の欄に, 級種, 会場コード, 受験番号を記入しマークしてください
More informationALG ppt
2012 6 21 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 l l O(1) l l l 2 (123 ) l l l l () l H(k) = k mod n (k:, n: ) l l 3 4 public class MyHashtable
More informationJava講座
~ 第 1 回 ~ 情報科学部コンピュータ科学科 2 年竹中優 プログラムを書く上で Hello world 基礎事項 演算子 構文 2 コメントアウト (//, /* */, /** */) をしよう! インデントをしよう! 変数などにはわかりやすい名前をつけよう! 要するに 他人が見て理解しやすいコードを書こうということです 3 1. Eclipse を起動 2. ファイル 新規 javaプロジェクト
More informationJavaハンドブック
Java ハンドブック (C) Copyright 2002-2004 ( 株 ) 永和システムマネジメント オブジェクト倶楽部天野勝 m-amano@esm.co.jp 初版 2002 年 11 月 1 日第 2 版 2002 年 11 月 21 日第 3 版 2004 年 11 月 19 日 オリジナル :http://www.objectclub.jp/technicaldoc/java/javahandbook.doc
More information** 平成 16 年度 FE 午後問題 Java** 示現塾プロジェクトマネージャ テクニカルエンジニア ( ネットワーク ) など各種セミナーを開催中!! 開催日 受講料 カリキュラム等 詳しくは 今すぐアクセス!! 平成 16
平成 16 年度春期 FE 午後問題 Java 問 8 次の Java プログラムの説明及びプログラムを読んで, 設問に答えよ プログラムの説明 このプログラムは, 数量の単位変換を行う共通機能を提供するクラス群と, それらのテストプログラムからなる テストプログラムでは, セルシウス温度 ( セ氏温度, ) 及びカ氏温度 ( F ) の変換を行うクラスを利用する (1) インタフェース Converter
More informationuntitled
2011 6 20 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2011/index.html tech.ac.jp/k1sakai/lecture/alg/2011/index.html html 1 O(1) O(1) 2 (123) () H(k) = k mod n
More information新・明解Javaで学ぶアルゴリズムとデータ構造
第 1 章 基本的 1 n 21 1-1 三値 最大値 algorithm List 1-1 a, b, c max // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); List 1-1 System.out.println("");
More informationMicrosoft Word - CompA-Ex doc
コンパイラ演習参考資料 2008/09/23 担当 : 佐々木晃 算術式の処理と逆ポーランド記法 ( 第一回スライド 29 ページ ) (1) 実数値 (double の値 ) を格納するスタックを実装せよ ( 配列やリストを使うとよい ) (2) 逆ポーランド記法によって実数値の算術演算を行う計算機のプログラムを作成せよ 演算子や被演算子の各要素同士は空白で区切られるものとする (a) 四則演算のみなお
More information問題1 以下に示すプログラムは、次の処理をするプログラムである
問題 1 次のプログラムの出力結果を a~d の中から選べ public class Problem1 { int i=2; int j=3; System.out.println("i"+j); a) 23,b) 5,c) i3,d) ij 問題 2 次のプログラムの出力結果を a~d の中から選べ public class Problem2 { int a=6; if((a>=2)&&(a
More informationPowerPoint Presentation
独習 Java ゼミ 11.4 PrintWriter クラス 11.5 バイトストリーム 07/06/22 鈴木慧 11.4 PrintWriter クラス PrintWhiter クラスとは Writer を拡張したクラス int float char などの基本データ型およびオブジェクトと等価の文字列を表示する PrintWriter コンストラクタ PrintWriter(OutputStream
More informationuntitled
Java 1 1 Java 1.1 Java 1.2 Java JavaScript 2 2.1 2.2 2.3 Java VM 3 3.1 3.2 3.3 3.4 4 Java 4.1 Java 4.2 if else 4.3 switch case 4.4 for 4.5 while 4.6 do-while 4.7 break, continue, return 4.8 try-catch-finally
More informationデジタル表現論・第4回
デジタル表現論 第 4 回 劉雪峰 ( リュウシュウフォン ) 2016 年 5 月 2 日 劉 雪峰 ( リュウシュウフォン ) デジタル表現論 第 4 回 2016 年 5 月 2 日 1 / 14 本日の目標 Java プログラミングの基礎 出力の復習 メソッドの定義と使用 劉 雪峰 ( リュウシュウフォン ) デジタル表現論 第 4 回 2016 年 5 月 2 日 2 / 14 出力 Systemoutprint()
More informationただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする ) ためには 同期処理を用いるこ とが必要になる 同期処理は 予約語 synchronized で行うことができる ここでは sy
オブジェクト指向プログラミング演習 2010/10/27 演習課題 スレッド ( その 2) 同期処理 結果不正 デッドロック 前回のスレッドの演習では 複数のスレッドを実行し 一つのプログラムの中の違う処理を同時に実行し た ただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする )
More informationohp07.dvi
17 7 (2) 2017.9.13 1 BNF BNF ( ) ( ) 0 ( ) + 1 ( ) ( ) [ ] BNF BNF BNF prog ::= ( stat ) stat ::= ident = expr ; read ident ; print expr ; if ( expr ) stat while ( expr ) stat { prog expr ::= term ( +
More informationMicrosoft PowerPoint - prog09.ppt
プログラミング言語 3 第 09 回 (2007 年 11 月 26 日 ) 1 今日の配布物 片面の用紙 1 枚 今日の課題が書かれています 本日の出欠を兼ねています 2/40 1 今日やること http://www.tnlab.ice.uec.ac.jp/~s-okubo/class/java06/ にアクセスすると 教材があります 2007 年 11 月 27 日分と書いてある部分が 本日の教材です
More informationMicrosoft PowerPoint - prog09.ppt
プログラミング言語 3 第 09 回 (2007 年 11 月 26 日 ) 1 今日の配布物 片面の用紙 1 枚 今日の課題が書かれています 本日の出欠を兼ねています 2/40 今日やること http://www.tnlab.ice.uec.ac.jp/~s-okubo/class/java06/ にアクセスすると 教材があります 2007 年 11 月 27 日分と書いてある部分が 本日の教材です
More informationI HTML HashMap (i) (ii) :.java import java.net.*; import java.io.*; import java.util.hashmap; public class SimpleStopWatch { public static voi
II Java 10 2 12 10:30 12:00 I. I III II. III. IV. ( a d) V. : this==null, T == N A ActionListener C class D actionperformed G getsource I implements K KeyListener J JApplet L addmouselistener M MouseListener
More information目的 泡立ち法を例に Comparableインターフェイスの実装 抽象クラスの利用 型パラメタの利用 比較 入替 の回数を計測
泡立ち法とその実装 計算機アルゴリズム特論 :2017 年度只木進一 目的 泡立ち法を例に Comparableインターフェイスの実装 抽象クラスの利用 型パラメタの利用 比較 入替 の回数を計測 Comparable インターフェイ ス クラスインスタンスが比較可能であることを示す Int compareto() メソッドを実装 Integer Double String などには実装済み public
More informationMicrosoft Word - keisankigairon.ch doc
1000000100001010 1000001000001011 0100001100010010 1010001100001100 load %r1,10 load %r2,11 add %r3,%r1,%r2 store %r3,12 k = i + j ; = > (* 1 2 3 4 5 6 7 8 9 10) 3628800 DO 3 I=1,3 DO3I=1.3 DO3I 1.3
More information( ) p.1 x y y = ( x ) 1 γ γ = filtergamma.java import java.applet.*; public class filtergamma extends Applet{ Image img; Image new_img; publi
e001d 00 1 1 ( ) Figure 1: 1 shikaku.java import java.applet.*; public class shikaku extends Applet{ public void paint( Graphics g) { g.drawrect(,,0,0 ); // x(,) width = 0,height=0 g.drawrect(,,0,0 );
More informationデータ構造とアルゴリズム論
15 11 11 Java 21 231-0811 32 152-0033 1 Java 3-5,55,63,39,87,48,70,35,77,59,44 3-5 3-7 score2.txt 75 15 11 11 5-1 3-7 jbuttonread jbuttondisplay jlabelmessage jtextfieldname jtextfieldtokuten
More information文字列操作と正規表現
文字列操作と正規表現 オブジェクト指向プログラミング特論 2018 年度只木進一 : 工学系研究科 2 文字列と文字列クラス 0 個以上の長さの文字の列 Java では String クラス 操作 文字列を作る 連結する 文字列中に文字列を探す 文字列中の文字列を置き換える 部分文字列を得る 3 String クラス 文字列を保持するクラス 文字列は定数であることに注意 比較に注意 == : オブジェクトとしての同等性
More informationProg2_9th
2013 年 11 月 21 日 ( 木 ) 実施例外処理 Java 言語では, 作成したプログラムを実行する際に, 記述した処理が想定しない事態によって実行できなくなる場合を例外と呼び, その例外への対処, 即ち例外処理が求められる これまでの教材に登場した例外の中で,IOException はコンパイラがチェックするため, 例外処理を必ず記述しなければコンパイルが出来ないものであるのに対して,ArithmeticException
More informationProg2_10th
2013 年 11 月 28 日 ( 木 ) 実施 ファイル操作とディレクトリ操作今回の授業では,Java 言語でのファイル操作とディレクトリ操作とについて学習する ファイル操作ファイル操作は,C 言語プログラミングで学んだように, 次の順序で行う 1) ストリームを開く 2) ストリームからの入力, ストリームへの出力 3) ストリームを閉じる Java 言語では, ファイル操作に関係するクラスが複数用意されている
More informationMicrosoft Word - java a.doc
4 入出力の基本として ディスプレイへの文字出力と キーボードからの文字入力の方法を学びます 入出力とは何か 標準出力 標準入力 43 4.1. 入出力とは プログラムと外部機器の間でデータをやりとりすることをいいます プログラムから出て行く方向が 出力 プログラムに入って来る方向が 入力 です 出力 外部機器 プログラム 入力 外部機器 外部機器はさまざまな種類があります 出力を行うには ディスプレイ
More information