Перейти к содержимому

JShell and Java Packages for Beginners: Try Code Instantly, Organise Classes | Java Course L126

The Modern SDE

0:00 / 0:00

JShell and Java Packages for Beginners: Try Code Instantly, Organise Classes | Java Course L126

5 просмотров · 7 дн. назад
The Modern SDE
1,25 тыс. подписчиков
5 просмотров · 7 дн. назад
Lecture 126 of the Complete Java Course for Beginners by Engineer X · Part 8: The Final Project and Modern Java Essentials. In this lecture • JShell, Java's REPL: read, evaluate, print, loop, part of the JDK since Java 9 • Snippets with no class, no main and no final semicolon: variables, expressions and methods • Forward references, a real error and an exception in JShell, plus /vars, /help, /exit, Tab and history • Packages give every class a unique full name, such as com.example.quiz.Question • Reverse-domain package names: all lowercase, with class names capitalised • The package statement: the first statement, one per file, before the imports • Matching folders, javac -d to build them, and running a class by its full name • Two real mistakes: running by the short name, and from inside the package folder Chapters 0:00 One line of Java 0:33 JShell: try Java instantly 2:08 Methods, errors and commands 3:34 Packages: full names for your classes 5:41 Folders, javac -d and running 7:17 Common mistake: the short name 7:55 Recap 8:18 Quick check 8:50 Up next Book reference: Head First Java (Kathy Sierra, Bert Bates, Trisha Gee), 3rd edition, #11 JShell (Java REPL), #10 Packages. The explanations, examples and code in this lecture are original. #Java #JavaForBeginners #LearnJava #JavaTutorial #Programming #EngineerX #JShell #JavaPackages #JavaREPL #LearnJava