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
140
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
38
Javaユーザーグループ北海道(JavaDo)の紹介 / BEACON#01 JavaDo
gishi_yama
0
43
Beyond Coding: Empowering the Next Generation through Community-Supported Programming Education / CIF26
gishi_yama
0
73
1password で 開発環境の環境変数を安全に管理したい / mild-web-sap #31
gishi_yama
0
65
新しいJavaを学んで・使っていこう! / osd26do
gishi_yama
0
280
Hokkaido JUGのJCP Annual Awards授賞式 / JJUG CCC 2026 Spring LT
gishi_yama
0
120
カンファレンスのCFPを 試しに書いてみよう! / JavaDo32
gishi_yama
0
400
開発環境構築の共通要素:必要なものを手元に持ってきて使えるようにする/JavaDo28
gishi_yama
0
220
ドメイン層×日本語プログラミング/seb_sapporo_04
gishi_yama
1
240
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Building AI with AI
inesmontani
PRO
1
1.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.3k
Balancing Empowerment & Direction
lara
6
1.4k
A designer walks into a library…
pauljervisheath
211
25k
Designing Powerful Visuals for Engaging Learning
tmiket
1
650
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Test your architecture with Archunit
thirion
2
2.5k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
750
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
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 参考 文 献