5 p Point int Java p Point Point p; p = new Point(); Point instance, p Point int 2 Point Point p = new Point(); p.x = 1; p.y = 2;
|
|
|
- みりあ いりぐら
- 8 years ago
- Views:
Transcription
1 5 p.1 5 JPanel (toy example) extends : Object java.lang.object extends... extends Object Point.java 1 public class Point { // public int x; public int y; Point x y 5.1.1,
2 5 p Point int Java p Point Point p; p = new Point(); Point instance, p Point int 2 Point Point p = new Point(); p.x = 1; p.y = 2; System.out.println("(" + p.x + ", " + p.y + ")"); Point p1 = new Point(), p2 = new Point(); p1.x = 1; p1.y = 2; p2.x = 9; p2.y = 8; System.out.println("(" + p1.x + ", " + p1.y + ")"); System.out.println("(" + p2.x + ", " + p2.y + ")"); C 5.3.1, Point.java 2
3 p.3 public class Point { // ( public int x; public int y; // public void move(int dx, int dy) { x += dx; y += dy; public double distance() { return Math.sqrt(x * x + y * y); public void print() { System.out.printf("(%d, %d)", x, y); public void moveandprint(int dx, int dy) { print(); move(dx, dy); print(); // public Point(int x0, int y0) { x = x0; y = y0; move distance, print, moveandprint x, y move print. Point int 2 : 1 Point p = new Point(1, 2); Point x 1 y 2
4 5 p.4 5. PointTest Point main PointTest.java public class PointTest { public static void main(string args[]) { Point p = new Point(10, 20); p.move(1, -1); p.print(); System.out.println("<br />"); static C C++ PointTest Java Q PointTest : PointTest.java Point.java PointTest.java javac Point.java 5.4 Point ColorPoint Point Point Point ColorPoint ColorPoint Point extends Point.java ColorPoint.java 1 public class ColorPoint extends Point { public String color;
5 p.5 public ColorPoint(int x, int y, String c) { super(x, y); /* 1 */ color = public void print() { System.out.printf("<font color= %s >", color); // System.out.printf("(%d, %d)", x, y); /* 2 */ // super.print(); System.out.print("</font>"); // ColorPoint color print() GUI JPanel super(x, y) /* 1 */ Point super : print() HTML HTML ColorPoint print() 2 /* 2 */ Point print() super.print(); super main 1 /* 3 */ ColorPoint x 10 y 20 color green ColorPoint Point x y move /* 4 */ PointTest.java 2 public static void main(string args[]) { ColorPoint cp = new ColorPoint(10, 20, "green"); /* 3 */ cp.move(1, -1); /* 4 */ cp.print();
6 5 p.6 5 System.out.println("<br />"); Q PointTest 2 Q DeepPoint Point int depth x, y, depth print depth 5 DeepPoint (((((11, 19))))) 5 DeepPoint DeepPoint.java public class DeepPoint { // public DeepPoint(int x, int y, int d) { depth = d; public void print() { int i; for (i = 0; i < depth; i++) { System.out.print("("); System.out.printf("%d, %d", x, y); for (i = 0; i < depth; i++) { System.out.print(")"); 5.5 PointTest testpoint Point PointTest.java 3 public static void testpoint(point p) { p.move(10, 10);
7 p.7 p.print(); main Point, ColorPoint, DeepPoint 3 testpoint PointTest.java 3 public static void main(string args[]) { Point p = new Point(1, 2); ColorPoint cp = new ColorPoint(3, 4, "green"); DeepPoint dp = new DeepPoint(5, 6, 5); testpoint(p); testpoint(cp); testpoint(dp); testpoint ColorPoint, DeepPoint Point, widening : CastTest.java ColorPoint cp = new ColorPoint(... ); Point p = cp; p.move(1, -1); CastTest.java // // p = new Point(3, 4); ColorPoint cp2 = (ColorPoint)p; // cp2.color = "red"; cp2.print(); p ColorPoint ClassCastException testpoint? testpoint move print ColorPoint?
8 5 p.8 5 Q PointTest.java 3 (1). (11, 12)(13, 14)(15, 16) (2). (11, 12)<font color= green >(13, 14)</font>(((((15, 16))))) Java print (dynamic binding) (static) (dynamic) C++ Java Point, ColorPoint, DeepPoint //... Point* p = new Point(1, 2); ColorPoint* cp = new ColorPoint(3, 4, "green"); DeepPoint* dp = new DeepPoint(5, 6, 5); testpoint(p); testpoint(cp); testpoint(dp); //... Point print (11, 12)(13, 14)(15, 16) C++ Java print (virtual function) *p, *cp, *dp Java C++ virtual class Point { // : C++ public: int x, y; void move(int dx, int dy); virtual void print(void); ; C++
9 p.9 Point moveandprint public void moveandprint(int dx, int dy) { print(); move(dx, dy); print(); moveandprint ColorPoint DeepPoint print moveandprint Point move print Point print moveandprint print (polymorphism) 1 Poly 2 Morph 1 (GUI) Java / JButton, JLabel, JTextField, JTextArea GUI JComponent javax.swing.jcomponent JComponent setvisible, setenabled, setlocation HideShow.java import javax.swing.*; import java.awt.*; import java.awt.event.*; public class HideShow extends JPanel implements ActionListener { private JTextField input; private JLabel lbl; 1 2 =
10 5 p.10 5 private JButton b1, b2; public HideShow() { setpreferredsize(new Dimension(300, 50)); lbl = new JLabel("label"); input = new JTextField("text", 5); b1 = new JButton("Hide"); b2 = new JButton("Show"); b1.addactionlistener(this); b2.addactionlistener(this); setlayout(new FlowLayout()); add(lbl); add(input); add(b1); add(b2); public void actionperformed(actionevent e) { if (e.getsource() == b1) { lbl.setvisible(false); input.setvisible(false); b1.setvisible(false); else if (e.getsource() == b2) { lbl.setvisible(true); input.setvisible(true); b1.setvisible(true);... // main Hide setvisible JComponent JComponent add = setvisible setvisible repaint paintcomponent
11 p : OverloadTest.java public class OverloadTest { double x, y; // public void foo(double dx, double dy) { // foo-1 x += dx; y += dy; public void foo(int dx, int dy) { // foo-2 x *= dx; y *= dy; public void print() { System.out.printf("(%g, %g)", x, y); System.out.println(); /* 1 */ public static void main(string[] args) { OverloadTest o = new OverloadTest(1.1, 2.2); o.foo(3.3, 4.4); // foo-1 o.print(); o.foo(2, 3); // foo-2 o.print(); /* 2 */ : Q OverloadTest.java /* 1 */ OverloadTest.java bar public void bar(point p) { System.out.print("Point class: "); // bar-1
12 5 p.12 5 p.print(); System.out.println(); public void bar(colorpoint p) { System.out.print("ColorPoint class: "); p.print(); System.out.println(); // bar-2 OverloadTest.java /* 2 */ ColorPoint cp = new ColorPoint(0, 0, "red"); Point p = cp; o.bar(cp); // bar-2 o.bar(p); // bar-1 Q OverloadTest.java /* 1 */, /* 2 */ Java. 5.7 ColorPoint color "red", "green" 2 setcolor getcolor ColorPoint "black", "red", "green", "yellow","blue", "magenta", "cyan", "white" String String == == true equals true java.lang.string public boolean equals(object s)
13 p.13 public boolean equalsignorecase(string s) ColorPoint.java 2 public class ColorPoint extends Point { public String[] cs = {"black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"; public String public void print() { // System.out.print("<font color= " + getcolor() + " >"); System.out.printf("(%d, %d)", x, y); // super.print(); System.out.print("</font>"); // public void setcolor(string c) { int i; for (i = 0; i < cs.length; i++) { if (c.equals(cs[i])) { color = c; return; // public ColorPoint(int x, int y, String c) { super(x, y); setcolor(c); if (color == null) color = "black"; public String getcolor() { return color; setcolor getcolor color cp.color = "NoSuchColor"; public 5.7.3
14 5 p.14 5 color ColorPoint... private String color; // color cs PointTest main cp.color = "NoSuchColor"; Q : public : protected private, public, protected public (encapsulation) ColorPoint color "black", "red" cs 2 private private
15 p color cs int ColorPoint DeepPoint depth 1 10 void setdepth(int d) depth int getdepth() setdepth depth depth setdepth SecretPoint Point 2 int a, b 2 print a x+b y = 1 (1, 2) (?,?) SecretPoint a, b print 5.8 < > Pair E1, E2 Pair.java public class Pair<E1, E2> { public E1 fst; public E2 snd; public Pair(E1 f, E2 s) { fst = f; snd = s; Triple.java public class Triple<E1, E2, E3> extends Pair<E1, E2> { public E3 thd; public Triple(E1 f, E2 s, E3 t) { super(f, s); thd = t; 3 color int
16 5 p.16 5 TripleTest.java public class TripleTest { public static void main(string[] args) { Triple<Integer, String, Double> test = new Triple<>(1, "abc", 1.4); System.out.printf("(%d, %s, %g)%n", test.fst, test.snd, test.thd); Player Enemy GenericEnemy Boss Enemy Alice Grace GenericEnemy Enemy attack GenericEnemy updatedamage : Player.java 1 public class Player { 2 private int hp; 3 4 public Player(int inithp) { 5 hp = inithp; public void damage(int damage) { 9 hp -= damage; 10 System.out.println(damage + " HP = " + hp); : Enemy.java 1 public class Enemy { 2 public void attack(player p) { 3 : GenericEnemy.java 1 public class GenericEnemy { 2 private String name; 3 public int damage; 4 5 public GenericEnemy(String n, int d) { 6 name = n; 7 damage = d; 8 9
17 p public void attack(player p) { 12 System.out.print(name + " : "); 13 p.damage(damage); 14 updatedamage(); public void updatedamage() { 18 : Alice.java 1 2 public class Alice { 3 private int init; 4 5 public Alice(int d) { 6 super("alice", d); 7 init = d; public void updatedamage() { 12 damage += init; // 13 // name += "!"; // : Grace.java 1 public class Grace { 2 private int ratio; 3 4 public Grace(int d, int r) { 5 super("grace", d); 6 ratio = r; public void updatedamage() { 11 damage *= ratio; // 12 // name += "?"; // : Boss.java 1 public class Boss { 2 public int count; 3 4 public Boss() { 5 count = 0;
18 5 p public void attack(player p) { 10 System.out.print("Boss : "); 11 if (++count >= 3) { 12 p.damage(1000); 13 else { 14 p.damage(0); main Main.java : Main.java 1 import java.util.arraylist; 2 3 public class Main { 4 public static void main(string[] args) { 5 ArrayList<Enemy> enemies = new ArrayList<>(); // ArrayList 6 Player p = new Player(3000); 7 8 Alice a = new Alice(100); 9 enemies.add(a); 10 Grace g = new Grace(100, 2); 11 enemies.add(g); 12 Boss b = new Boss(); 13 enemies.add(b); for (int i = 0; i < 3; i++) { 16 for (int j = 0; j < enemies.size(); j++) { 17 Enemy e = enemies.get(j); 18 e.attack(p); Main main
19 p.19,,,,
20
I. (i) Java? (A). Foo_Bar (B). G day (C). 999 (D). Golgo13 (ii)? (A). Java public (B). Java (C). Java JavaScript (D). Java C Java C (iii)? (A). Java (
2016 07 29 10:30 12:00 I. I V II. III. IV. ( a d) V. VI. 80 100 60 : A ActionListener aa addactionlistener AE ActionEvent K KeyListener ak addkeylistener KE KeyEvent M MouseListener am addmouselistener
I 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
I. (i) Foo public (A). javac Foo.java java Foo.class (C). javac Foo java Foo (ii)? (B). javac Foo.java java Foo (D). javac Foo java Foo.class (A). Jav
2018 06 08 11:00 12:00 I. I III II. III. IV. ( a d) V. VI. 80 40 40 100 60 : A ActionListener aa addactionlistener AE ActionEvent K KeyListener ak addkeylistener KE KeyEvent M MouseListener am addmouselistener
II Java :30 12:00 I. I IV II. III. IV. ( a d) V. : this==null, T == N A ActionListener C class D actionperformed G getsource I implements K
II Java 09 2 13 10:30 12:00 I. I IV 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
:30 12:00 I. I VII II. III. IV. ( a d) V. VI : this==null, T == N A ActionListener A addactionlistener C class D actionperforme
2014 8 01 10:30 12:00 I. I VII II. III. IV. ( a d) V. VI. 80 100 60 : this==null, T == N A ActionListener A addactionlistener C class D actionperformed E ActionEvent G getsource I implements J JApplet
I 4 p.2 4 GUI java.awt.event.* import /* 1 */ import mouseclicked MouseListener implement /* 2 */ init addmouselistener(this) this /* 3 */ this mousec
I 4 p.1 4 GUI GUI GUI 4.1 4.1.1 MouseTest.java /* 1 */ public class MouseTest extends JApplet implements MouseListener /* 2 */ { int x=50, y=20; addmouselistener(this); /* 3 */ public void mouseclicked(mouseevent
2 static final int DO NOTHING ON CLOSE static final int HIDE ON CLOSE static final int DISPOSE ON CLOSE static final int EXIT ON CLOSE void setvisible
12 2013 7 2 12.1 GUI........................... 12 1 12.2............................... 12 4 12.3..................................... 12 7 12.4....................................... 12 9 12.5 : FreeCellPanel.java............................
Java学習教材
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("
Java 3 p.2 3 Java : boolean Graphics draw3drect fill3drect C int C OK while (1) int boolean switch case C Calendar java.util.calendar A
Java 3 p.1 3 Java Java if for while C 3.1 if Java if C if if ( ) 1 if ( ) 1 else 2 1 1 2 2 1, 2 { Q 3.1.1 1. int n = 2; if (n
新・明解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,
10/ / /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
[email protected] [email protected] 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
Java演習(9) -- クラスとメソッド --
Java (9) Java (9) Java (9) 3 (x, y) x 1 30 10 (0, 50) 1 2 10 10 (width - 10, 80) -2 3 50 10 (width / 2, 110) 2 width 3 (RectMove4-1.java) import javax.swing.japplet; import javax.swing.timer; import java.awt.graphics;
目 次 Java GUI 3 1 概要 クラス構成 ソースコード例 課題...7 i
Java GUI 3 Java GUI 3 - サンプルプログラム (1) - 2011-09-25 Version 1.00 K. Yanai 目 次 Java GUI 3 1 概要...1 2 クラス構成...2 3 ソースコード例...3 4 課題...7 i 1 概要まずは簡単なサンプルプログラムをみながら Java GUI の基本的なことを学びましょう 本サンプルは 図に示すようなひとつのメイン画面を使用します
Object MenuComponent MenuBar MenuItem Menu CheckboxMenuItem
Java Object MenuComponent MenuBar MenuItem Menu CheckboxMenuItem 2 MenuComponent MenuComponent setfont() void setfont(font f) MenuBar MenuBar MenuBar() MenuBar add() Menu add(menu m) Menu Menu Menu String
2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q B
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM IDESun Microsystems Oracle NetBeans, IBM 1 Eclipse 2, JetBrains IntelliJ IDEA IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 GUI
やさしい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
class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =
Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value
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
10K pdf
#1 #2 Java class Circle { double x; // x double y; // y double radius; // void set(double tx, double ty){ x = tx; y = ty; void set(double tx, double ty, double r) { x = tx; y = ty; radius = r; // Circle
Javaセキュアコーディングセミナー2013東京第1回 演習の解説
Java セキュアコーディングセミナー東京 第 1 回オブジェクトの生成とセキュリティ 演習の解説 2012 年 9 月 9 日 ( 日 ) JPCERT コーディネーションセンター脆弱性解析チーム戸田洋三 1 演習 [1] 2 演習 [1] class Dog { public static void bark() { System.out.print("woof"); class Bulldog
I 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..........................................
Local variable x y i paint public class Sample extends Applet { public void paint( Graphics gc ) { int x, y;... int i=10 ; while ( i < 100 ) {... i +=
Safari AppletViewer Web HTML Netscape Web Web 13-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web update Event Driven paint Signature Overwriting Overriding
Microsoft 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
public class Kadai _02 { public static void main(string[] args) { MyFrame frame = new MyFrame("Kadai _02"); (2) フレームのクラス名は MyFrame とし 以下
オブジェクト指向プログラミング演習課題 20071128 以下のような GUI 画面を表示するプログラムを完成させなさい 前回演習で作成したプログラムにイベント処理を追加します 注意 : ファイル名が同じものがあるので 課題毎にディレクトリーを分ける等してください 課題 20071128_01 講義資料内で紹介したイベント処理の例 2 を作成し 動作を確認せよ (1) コントロールクラス (main
r1.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
IE6 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
Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac
Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN
class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =
Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value
r3.dvi
10 3 2010.9.21 1 1) 1 ( 1) 1: 1) 1.0.1 : Java 1 import java.awt.*; import javax.swing.*; public class Sample21 extends JPanel { public void paintcomponent(graphics g) { g.setcolor(new Color(255, 180, 99));
4 p.2 4 GUI return; public void mousepressed(mouseevent e) { /* 5 */ public void mousereleased(mouseevent e) { /* 5 */ public void mouseentered(mousee
4 p.1 4 GUI GUI GUI Java Java try catch C 4.1 4.1.1 4.1.1 MouseTest.java import javax.swing.*; import java.awt.*; import java.awt.event.*; /* 1 */ public class MouseTest extends JPanel implements MouseListener
2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q B
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDESun Microsystems NetBeans, IBM 1 Eclipse 2 IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 Hello World Emacs Hello0.java
3 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
次の演習課題(1),(2)のプログラムを完成させよ
次の演習課題 (1),(2) のプログラムを作成せよ. 課題 (1) ボタン押下時の処理を追加し以下の実行結果となるようにプログラムを作成しなさい ( ボタン押下時の処理 ) import java.lang.*; class Figure extends JFrame implements ActionListener{ JPanel panel; JScrollPane scroll; JTextArea
< F2D82518E9F8AD CC834F CC8CFC82AB82C68D4C>
2 次関数のグラフの向きと広がり [Java アプレット ] [Java アプリケーション ] 1. はじめに 2 2 y=ax のグラフについて x の係数 aが正のときと負のときでは グラフにどのような違いがあるでしょうか 2 2 y=ax のグラフについて x の係数 aが正のとき 係数 aの値が大きくなるにつれて グラフの広がりはどうなるでしょうか 2 2 y=ax のグラフについて x の係数
明解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
< F2D A839382CC906A2E6A7464>
ビュホンの針 1. はじめに [Java アプレット ] [Java アプリケーション ] ビュホン ( Buffon 1707-1788) は 針を投げて円周率 πを求めることを考えました 平面上に 幅 2aの間隔で 平行線を無数に引いておきます この平面上に長さ2bの針を落とすと この針が平行線と交わる確立 pは p=(2b) (aπ) 1 となります ただし b
55 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]));
Java 2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q 2.
Java 2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDE Sun Microsystems NetBeans, IBM 1 Eclipse 2 IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 Hello World Emacs
Java言語 第1回
Java 言語 第 11 回ウインドウ型アプリケーション (2) 知的情報システム工学科 久保川淳司 [email protected] メニュー (1) メニューを組み込むときには,MenuBar オブジェクトに Menu オブジェクトを登録し, その Menu オブジェクトに MenuItem オブジェクトを登録する 2 つの Menu オブジェクト File New
3 p.1 3 Java Java Java try catch C Java if for while C 3.1 boolean Java if C if ( ) 1 if ( ) 1 else , 2 { } boolean true false 2 boolean Gr
3 p.1 3 Java Java Java try catch C Java if for while C 3.1 boolean Java if C if ( ) 1 if ( ) 1 else 2 1 1 2 2 1, 2 { boolean true false 2 boolean Graphics draw3drect fill3drect C int C OK while (1)...
Java演習(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
: : : TSTank 2
Java (8) 2008-05-20 Lesson6 Lesson5 Java 1 Lesson 6: TSTank1, TSTank2, TSTank3 java 2 car1 car2 Car car1 = new Car(); Car car2 = new Car(); car1.setcolor(red); car2.setcolor(blue); car2.changeengine(jet);
アルゴリズムとデータ構造1
1 2005 7 22 22 (sakai.keiichi@kochi [email protected]) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2005/index.html tech.ac.jp/k1sakai/lecture/alg/2005/index.html f(0) = 1, f(x) =
解きながら学ぶ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
2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q B
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDESun Microsystems NetBeans, IBM 1 Eclipse 2 IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 Hello World Emacs Hello0.java
Java (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
明解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("");
. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Pr
Eclipse 1,a) 1,b) 1,c) ( IDE) IDE Graphical User Interface( GUI) GUI GUI IDE View Eclipse Development of Eclipse Plug-in to present an Object Diagram to Debug Environment Kubota Yoshihiko 1,a) Yamazaki
2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java
1 Java Java 1.1 Java 1) 2) 3) Java OS Java 1.3 4) Java Web Start Web / 5) Java C C++ Java JSP(Java Server Pages) 1) OS 2) 3) 4) Java Write Once, Run Anywhere 5) Java Web Java 2 1 Web Java Android Java
データ構造とアルゴリズム論
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
Applet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet
13 Java 13.9 Applet 13.10 AppletContext 13.11 Applet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet Applet (1/2) Component GUI etc Container Applet (2/2) Panel
2 p.2 2 Java > javac Hello0.java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.j
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDESun Microsystems Oracle NetBeans, IBM 1 Eclipse 2, JetBrains IntelliJ IDEA IDE GUI JDK Java 2.1 Hello World! 2.1.1
KeyListener init addkeylistener addactionlistener addkeylistener addkeylistener( this ); this.addkeylistener( this ); KeyListener public void keytyped
KeyListener keypressed(keyevent e) keyreleased(keyevent e) keytyped(keyevent e) MouseListener mouseclicked(mouseevent e) mousepressed(mouseevent e) mousereleased(mouseevent e) mouseentered(mouseevent e)
15 Java 15.5 15.6 15.7 Checkbox() Checkbox(String str) Checkbox(String str, boolean state) Checkbox(String str, boolean state, CheckboxGroup grp) Checkbox(String str, CheckboxGroup grp, boolean state)
