Java TutorialLesson 4Free preview
Java Syntax
This lesson is part of Java · All levels
Summary
This lesson explains the basic rules of writing Java code, from classes, playing methods, statements ending in semicolons, to the sensitivity of the capital letters. Java demands a neat structure: each program contains at least one class, and the statement is written one by one within the method. A misspelling or punctuation error will cause compilation error.
Key points
- All Java code is in class; the statement method is in the play method when it's the main program.
- Each statement ends with a semicolon (;) as the command endpoints
- Java is case sensitive: MyVariable and myvariable are considered different
- Curly braces {} mark the beginning and end of a block of code like a class and a method
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.