Skip to content

praju026/JAVA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

JAVA

Java Fundamentals: Syntax & Semantics

✅ Definition

  • Syntax: The set of rules that define how Java programs are written. If syntax rules are violated, the compiler throws an error.
  • Semantics: The meaning behind correctly written code. Even if code compiles, semantics determine whether it behaves as intended.
    (Ref: Java Language Specification, §1.1, §3)

✅ Why Important?

  • Syntax ensures your code can compile and run.
  • Semantics ensures your code produces correct results.
  • Both are necessary to build maintainable, error-free applications and real-world projects.

✅ Where Used?

  • Syntax: Always, in every Java program. Example: placing a semicolon after a statement, using braces for blocks.
  • Semantics: While designing logic—e.g., knowing what == vs .equals() means.

✅ When to Focus?

  • Syntax: During initial learning and writing code under time pressure (like coding rounds).
  • Semantics: During debugging, interviews (trick questions on logic), and writing scalable applications.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages