Outlookに他人の予定表を表示させる方法を追加
Download from
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Java SE Development Kit 8u121
Java SE Development Kit 8u121 Demos and Samples
x86 version
Install
開発ツールを選択
開発ガイド
http://docs.oracle.com/javase/8/docs/
---------------------------------------------------------------------------
hello world in Windows
http://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html
command prompt
C:\Users\a_mizuno\Desktop\Work\Java>
% javac HelloWorldApp.java
=> HelloWorldApp.class is generated
% java -cp . HelloWorldApp
Java のアプリケーションには main method が必要
public static void main(String[] args)
Inheritance
class MountainBike extends Bicycle {..}
Interface
class ACMEBicycle implements Bicycle {..}
http://docs.oracle.com/javase/tutorial/networking/overview/networking.html
http://docs.oracle.com/javase/tutorial/networking/sockets/index.html
http://docs.oracle.com/javase/8/docs/technotes/guides/desc_jdk_structure.html
* java : launches a Java application
java [options] classname [args]
java [options] -jar filename [args]
Options
-cp class path: specify a list of directories to search for class files.
* javac
http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html
javac [options] [sourcefiles] [classes] [@argfiles]
sourcefiles *.java
=> generates *.class
Options
-d directory: set the destination directory
invokes the class's main()
http://www.oracle.com/technetwork/java/index-138747.html
Applet
import java.applet.Applet;
public class SimpleApplet extends Applet{...}
in HTML
<BODY>
<APPLET CODE=SimpleApplet.class WIDTH=200 HEIGHT=100>
</APPLET>
</BODY>
appletviewer simpleApplet.html
---------------------------------------------------------------------------
http://docs.oracle.com/javase/specs/jls/se8/html/index.html
http://www.javaroad.jp/index_basic.htm
http://www.tohoho-web.com/java/syntax.htm
数値
間に _ を入れてよい
2進数 0b001
long 最後に L をつける
型
char 2-byte unicode 符号なし数値はこれを使うしかない
Refernce Type
class など 基本型以外 new で生成
class 変数の初期値は null
定数は final (final float PI=3.4)
配列
個数は length (int[]xx = new int[3]; int n = xx.length;)
API,class,package
https://docs.oracle.com/javase/8/docs/api/overview-summary.html
https://docs.oracle.com/javase/jp/6/api/java/net/Socket.html
System.out is PrintStream
String
a.equals(b)
String[] arg; String[] param = arg.split(":");
int a = Integer.parseInt(param[1]);
16進数表記
public static String toHexString(int i)
System.out.println(Integer.toHexString(arr[i] & 0xff));
Thread.sleep(1000) // 1000ms
Thread.sleep(0, 100) // 100ns
---------------------------------------------------------------------------
https://docs.oracle.com/javase/jp/6/api/java/net/Socket.html
Search with "Java socket API"
複数の通信を受け付けるサーバ
http://www.techscore.com/tech/Java/JavaSE/Network/3-2/
accept でブロックされるので、accept も thread の中に書く
http://mergedoc.osdn.jp/index.html#/pleiades.html
Pleiades All in One 4.4.2.v20150310
Eclipse 4.4 Luna ルナ SR2 for Windows ベース
http://kaya-soft.com/java-toranomaki/programming/devenv/entry1-5_install-pleiadesallinone/