{"action":"created","comment":{"url":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/comments/62187961","id":62187961,"diff_hunk":"@@ -0,0 +1,52 @@\n+---\n+layout: page\n+title: \"JavaからRubyへ\"\n+lang: ja\n+---\n+\n+Javaは成熟しており、よくテストされています。\n+アンチJavaな人々が訴えるのに反して、Javaは高速です。ですが、とても冗長です。\n+JavaからRubyへ移行すると、コードの量を大幅に削減できます。\n+プロトタイピングを少ない時間で済ませられるようになるでしょう。\n+\n+### Javaとの類似\n+\n+Javaと同様に、Rubyは...\n+\n+* メモリはGCによって管理されます。\n+* オブジェクトは強い型付けがされます。\n+* メソッドにはpublic、private、protectedを指定できます。\n+* 埋め込み型のドキュメントツールがあります(Ruby用のツールはRDocと呼ばれます)。\n+  rdocで生成されたドキュメントはjavadocで生成したドキュメントにとてもよく似ています。\n+\n+### Javaとの違い\n+\n+Javaと違って、Rubyは...\n+\n+* コードをコンパイルする必要はありません。単に実行するだけです。\n+* 異なったサードパーティ製のGUIツールキットがいくつか存在します。\n+  Rubyのユーザーは、たとえば[WxRuby][1]、[FXRuby][2]、[Ruby-GNOME2][3]、[Qt][4]、\n+  あるいはRubyに同梱されているRuby Tkなどを利用します。\n+* クラスなどの定義の最後には`end`キーワードを使います。コードのまとまりを波括弧で括ることはしません。\n+* `import`の代わりに`require`を使います。\n+* すべてのメンバ変数はプライベード変数です。オブジェクトの外側からはメソッドを介してそれらにアクセスします。\n+* メソッド呼び出しの括弧は基本的にオプションで、しばしば省略されます。\n+* 2や3.14159といった数値も含めて、すべてのものはオブジェクトです。\n+* 静的型チェックはありません。\n+* 変数名はただのラベルです。変数名は関連付けられた型を持ちません。\n+* 型宣言はありません。必要に応じて新しい変数名を割りあてれば、それらを利用できます\n+  (`int[] a = {1,2,3};`ではなく`a = [1,2,3]`というように)。\n+* キャストはありません。メソッドを呼び出すだけです。\n+  例外を確認するつもりなら、コードを実行する前にユニットテストで示しましょう。\n+* `Foo foo = new Foo(\"hi\")`は`foo = Foo.new(\"hi\")`と書きます。\n+* コンストラクタは常に”initialize”という名前になります。クラス名ではありません。\n+* インターフェイスの代わりにMix-inを使います。\n+* XMLよりもYAMLが好まれます。\n+* `null`は`nil`です。\n+* `==`と`equals()`の扱いが異なります。等価かどうかを評価したい時(Javaで`equals()`を使うケース)は`==`を使います。\n+  二つのオブジェクトが同一かどうかを確認したい時(Javaで`==`を使うケース)は`equal?()`を使います。\n+\n+[1]: http://wxruby.rubyforge.org/wiki/wiki.pl\n+[2]: http://www.fxruby.org/\n+[3]: http://ruby-gnome2.sourceforge.jp/","path":"ja/documentation/ruby-from-other-languages/to-ruby-from-java/index.md","position":51,"original_position":51,"commit_id":"4ce49be578761d3ae929357b9722d23c4b1a3d2d","original_commit_id":"4ce49be578761d3ae929357b9722d23c4b1a3d2d","user":{"login":"snoozer05","id":3954,"avatar_url":"https://avatars.githubusercontent.com/u/3954?v=3","gravatar_id":"","url":"https://api.github.com/users/snoozer05","html_url":"https://github.com/snoozer05","followers_url":"https://api.github.com/users/snoozer05/followers","following_url":"https://api.github.com/users/snoozer05/following{/other_user}","gists_url":"https://api.github.com/users/snoozer05/gists{/gist_id}","starred_url":"https://api.github.com/users/snoozer05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoozer05/subscriptions","organizations_url":"https://api.github.com/users/snoozer05/orgs","repos_url":"https://api.github.com/users/snoozer05/repos","events_url":"https://api.github.com/users/snoozer05/events{/privacy}","received_events_url":"https://api.github.com/users/snoozer05/received_events","type":"User","site_admin":false},"body":"Thank you. I fix it.","created_at":"2016-05-05T13:42:08Z","updated_at":"2016-05-05T13:42:08Z","html_url":"https://github.com/ruby/www.ruby-lang.org/pull/1359#discussion_r62187961","pull_request_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359","_links":{"self":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/comments/62187961"},"html":{"href":"https://github.com/ruby/www.ruby-lang.org/pull/1359#discussion_r62187961"},"pull_request":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359"}}},"pull_request":{"url":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359","id":67627180,"html_url":"https://github.com/ruby/www.ruby-lang.org/pull/1359","diff_url":"https://github.com/ruby/www.ruby-lang.org/pull/1359.diff","patch_url":"https://github.com/ruby/www.ruby-lang.org/pull/1359.patch","issue_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/issues/1359","number":1359,"state":"open","locked":false,"title":"Translate ruby-from-other-languages(ja)","user":{"login":"snoozer05","id":3954,"avatar_url":"https://avatars.githubusercontent.com/u/3954?v=3","gravatar_id":"","url":"https://api.github.com/users/snoozer05","html_url":"https://github.com/snoozer05","followers_url":"https://api.github.com/users/snoozer05/followers","following_url":"https://api.github.com/users/snoozer05/following{/other_user}","gists_url":"https://api.github.com/users/snoozer05/gists{/gist_id}","starred_url":"https://api.github.com/users/snoozer05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoozer05/subscriptions","organizations_url":"https://api.github.com/users/snoozer05/orgs","repos_url":"https://api.github.com/users/snoozer05/repos","events_url":"https://api.github.com/users/snoozer05/events{/privacy}","received_events_url":"https://api.github.com/users/snoozer05/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-24T04:33:27Z","updated_at":"2016-05-05T13:42:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7275bd583937762655deb28548c40c6803a77b2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359/commits","review_comments_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359/comments","review_comment_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/issues/1359/comments","statuses_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/statuses/4ce49be578761d3ae929357b9722d23c4b1a3d2d","head":{"label":"snoozer05:ja-ruby-from-other-languages","ref":"ja-ruby-from-other-languages","sha":"4ce49be578761d3ae929357b9722d23c4b1a3d2d","user":{"login":"snoozer05","id":3954,"avatar_url":"https://avatars.githubusercontent.com/u/3954?v=3","gravatar_id":"","url":"https://api.github.com/users/snoozer05","html_url":"https://github.com/snoozer05","followers_url":"https://api.github.com/users/snoozer05/followers","following_url":"https://api.github.com/users/snoozer05/following{/other_user}","gists_url":"https://api.github.com/users/snoozer05/gists{/gist_id}","starred_url":"https://api.github.com/users/snoozer05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoozer05/subscriptions","organizations_url":"https://api.github.com/users/snoozer05/orgs","repos_url":"https://api.github.com/users/snoozer05/repos","events_url":"https://api.github.com/users/snoozer05/events{/privacy}","received_events_url":"https://api.github.com/users/snoozer05/received_events","type":"User","site_admin":false},"repo":{"id":22297533,"name":"www.ruby-lang.org","full_name":"snoozer05/www.ruby-lang.org","owner":{"login":"snoozer05","id":3954,"avatar_url":"https://avatars.githubusercontent.com/u/3954?v=3","gravatar_id":"","url":"https://api.github.com/users/snoozer05","html_url":"https://github.com/snoozer05","followers_url":"https://api.github.com/users/snoozer05/followers","following_url":"https://api.github.com/users/snoozer05/following{/other_user}","gists_url":"https://api.github.com/users/snoozer05/gists{/gist_id}","starred_url":"https://api.github.com/users/snoozer05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoozer05/subscriptions","organizations_url":"https://api.github.com/users/snoozer05/orgs","repos_url":"https://api.github.com/users/snoozer05/repos","events_url":"https://api.github.com/users/snoozer05/events{/privacy}","received_events_url":"https://api.github.com/users/snoozer05/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/snoozer05/www.ruby-lang.org","description":"Source of the https://www.ruby-lang.org website.","fork":true,"url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org","forks_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/forks","keys_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/teams","hooks_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/hooks","issue_events_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/issues/events{/number}","events_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/events","assignees_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/assignees{/user}","branches_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/branches{/branch}","tags_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/tags","blobs_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/statuses/{sha}","languages_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/languages","stargazers_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/stargazers","contributors_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/contributors","subscribers_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/subscribers","subscription_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/subscription","commits_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/contents/{+path}","compare_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/merges","archive_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/downloads","issues_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/issues{/number}","pulls_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/pulls{/number}","milestones_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/milestones{/number}","notifications_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/labels{/name}","releases_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/releases{/id}","deployments_url":"https://api.github.com/repos/snoozer05/www.ruby-lang.org/deployments","created_at":"2014-07-26T22:12:32Z","updated_at":"2016-03-25T16:58:33Z","pushed_at":"2016-05-05T12:50:20Z","git_url":"git://github.com/snoozer05/www.ruby-lang.org.git","ssh_url":"git@github.com:snoozer05/www.ruby-lang.org.git","clone_url":"https://github.com/snoozer05/www.ruby-lang.org.git","svn_url":"https://github.com/snoozer05/www.ruby-lang.org","homepage":"","size":40462,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ruby:master","ref":"master","sha":"983927d76e69d94482e7c616135fe5fd59bd08e7","user":{"login":"ruby","id":210414,"avatar_url":"https://avatars.githubusercontent.com/u/210414?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby","html_url":"https://github.com/ruby","followers_url":"https://api.github.com/users/ruby/followers","following_url":"https://api.github.com/users/ruby/following{/other_user}","gists_url":"https://api.github.com/users/ruby/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby/subscriptions","organizations_url":"https://api.github.com/users/ruby/orgs","repos_url":"https://api.github.com/users/ruby/repos","events_url":"https://api.github.com/users/ruby/events{/privacy}","received_events_url":"https://api.github.com/users/ruby/received_events","type":"Organization","site_admin":false},"repo":{"id":2147447,"name":"www.ruby-lang.org","full_name":"ruby/www.ruby-lang.org","owner":{"login":"ruby","id":210414,"avatar_url":"https://avatars.githubusercontent.com/u/210414?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby","html_url":"https://github.com/ruby","followers_url":"https://api.github.com/users/ruby/followers","following_url":"https://api.github.com/users/ruby/following{/other_user}","gists_url":"https://api.github.com/users/ruby/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby/subscriptions","organizations_url":"https://api.github.com/users/ruby/orgs","repos_url":"https://api.github.com/users/ruby/repos","events_url":"https://api.github.com/users/ruby/events{/privacy}","received_events_url":"https://api.github.com/users/ruby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby/www.ruby-lang.org","description":"Source of the https://www.ruby-lang.org website.","fork":false,"url":"https://api.github.com/repos/ruby/www.ruby-lang.org","forks_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/forks","keys_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/teams","hooks_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/hooks","issue_events_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/issues/events{/number}","events_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/events","assignees_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/assignees{/user}","branches_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/branches{/branch}","tags_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/tags","blobs_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/languages","stargazers_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/stargazers","contributors_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/contributors","subscribers_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/subscribers","subscription_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/subscription","commits_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/contents/{+path}","compare_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/merges","archive_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/downloads","issues_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/issues{/number}","pulls_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/labels{/name}","releases_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/releases{/id}","deployments_url":"https://api.github.com/repos/ruby/www.ruby-lang.org/deployments","created_at":"2011-08-03T08:29:44Z","updated_at":"2016-04-30T16:33:04Z","pushed_at":"2016-05-04T10:41:03Z","git_url":"git://github.com/ruby/www.ruby-lang.org.git","ssh_url":"git@github.com:ruby/www.ruby-lang.org.git","clone_url":"https://github.com/ruby/www.ruby-lang.org.git","svn_url":"https://github.com/ruby/www.ruby-lang.org","homepage":"","size":43372,"stargazers_count":583,"watchers_count":583,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":398,"mirror_url":null,"open_issues_count":35,"forks":398,"open_issues":35,"watchers":583,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359"},"html":{"href":"https://github.com/ruby/www.ruby-lang.org/pull/1359"},"issue":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/issues/1359"},"comments":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/issues/1359/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/pulls/1359/commits"},"statuses":{"href":"https://api.github.com/repos/ruby/www.ruby-lang.org/statuses/4ce49be578761d3ae929357b9722d23c4b1a3d2d"}}}}