PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Java · Theory

Java Keywords

← All stacks

Theory

14/270

Java Keywords

Keywords are words Java already uses: class, public, static, void, new, if, for, try. You cannot name a variable class or new. The compiler reads these words to understand the program.

true, false, and null are special values, not normal names. Learn what the common keywords do. You don’t need to mug up a list of fifty words.

In a viva, pick five and say one line each: class, new, static, void, return.

Let's take this on the board with one tiny Main class — no extra files. Java Keywords — final, boolean, if, true are keywords used with normal meaning. Start from main, go line by line, and stop at each print. That output is the proof for Keywords.

Exam tip

Pick five keywords and say one line each: class, new, static, void, return.

Example

// Keywords in real code
public class Main {
  public static void main(String[] args) {
    final int MAX = 10; // final is a keyword
    boolean ok = true;   // boolean / true are keywords
    if (ok) {
      System.out.println("MAX = " + MAX);
    }
  }
}

Java Keywords — final, boolean, if, true are keywords used with normal meaning.

Short notes

  • DefKeywords are reserved words Java already uses.
  • RuleYou cannot use them as variable names — class, new, if, for…
  • RememberKnow meaning of common ones. Don’t mug 50 names.
  • Useclass, public, static, void, new, return, if, for, try.

Questions

1

Can you name a variable class?

2

Name five keywords.

Previous← Java OperatorsNextControl Statements in Java →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.