Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Javaへの新たなHello, World / yuruchitose-04
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hiroto YAMAKAWA
October 20, 2024
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Javaへの新たなHello, World / yuruchitose-04
#ゆる千歳 Vol.04 でのLTスライドです
Hiroto YAMAKAWA
October 20, 2024
More Decks by Hiroto YAMAKAWA
See All by Hiroto YAMAKAWA
日本PostgreSQLユーザー会北海道支部(JPUG-Ezo)の紹介 / BEACON#01 JPUG-Ezo
gishi_yama
0
36
Javaユーザーグループ北海道(JavaDo)の紹介 / BEACON#01 JavaDo
gishi_yama
0
40
Beyond Coding: Empowering the Next Generation through Community-Supported Programming Education / CIF26
gishi_yama
0
69
1password で 開発環境の環境変数を安全に管理したい / mild-web-sap #31
gishi_yama
0
62
新しいJavaを学んで・使っていこう! / osd26do
gishi_yama
0
270
Hokkaido JUGのJCP Annual Awards授賞式 / JJUG CCC 2026 Spring LT
gishi_yama
0
110
カンファレンスのCFPを 試しに書いてみよう! / JavaDo32
gishi_yama
0
390
開発環境構築の共通要素:必要なものを手元に持ってきて使えるようにする/JavaDo28
gishi_yama
0
210
ドメイン層×日本語プログラミング/seb_sapporo_04
gishi_yama
1
240
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
47k
Building an army of robots
kneath
307
47k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
Unsuck your backbone
ammeep
672
58k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Accessibility Awareness
sabderemane
1
260
The Language of Interfaces
destraynor
162
27k
Statistics for Hackers
jakevdp
799
230k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
490
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Transcript
#ゆるちとせ Javaへの新たな "Hello, World" 山川広人 (@gishi_yama) 公立千歳科学技術大学 情報システム科 准教授 Javaユーザグループ北海道 リーダー
 1
#ゆるちとせ Javaを初めて学ぶときの「おまじない」 2 public class HelloWorld { public static void
main(String[] args) { System.out.println("Hello World"); } } やりたいことは「プログラムを実行したら Hello World! と表示する」なのに、 (初学者にとっては)高度な内容が入りすぎている →わからない、難しいという印象を与えすぎてしまう 🫠
#ゆるちとせ A Smooth On-Ramp (Javaへのスムーズな 入口車 線) 3
#ゆるちとせ Demo1 4 void main() { println("Hello Java!"); } 実行してみたい場合は,Foo.java
に上記のいずれかを記載し, java --enable-preview --source 23 Foo.java で実行できる void main() { String inputted = readln("入力してください:"); show(inputted); } void show(String str) { println(str); } 表示だけのHello, World! 入力を伴う Hello, World!
#ゆるちとせ Demo2(あえてクラスを宣 言 すると) 5 import static java.io.IO.*; class Java23b
{ void main() { String inputted = readln("入力してください:"); show(inputted); } void show(String str) { println(str); } } クラスを定義する場合は,java.io.IO.* のインポートが必要 java.io.IOクラスには,readln, println などが定義されている → https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/io/IO.html
#ゆるちとせ • 起動用クラスの psvm が不要になる • 入出力の「System.out」「System.in(にまつわるクラス)」の記述が省略 (ただし、明確な起動用クラス定義をする場合は、java.io.IO.* のインポートは必要) 今後のJavaでは
6 ※現時点(Java 23)ではpreview機能なので、起動時にパラメータが必要なので注意 • @nowokay(きしだ なおき) "Java 23新機能まとめ" https://qiita.com/nowokay/items/7650b959fd4b0be54751 • Brian Goetz "Paving the on-ramp" https://openjdk.org/projects/amber/design-notes/on-ramp • ひしだま's 技術メモページ "mainメソッド簡略化(Java21~23) https://www.ne.jp/asahi/hishidama/home/tech/java/preview/main.21.html 参考 文 献