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 throws Keyword

← All stacks

Theory

96/270

Java throws Keyword

throws is on the method signature: void read() throws IOException. It warns callers: this method might throw that checked exception. Callers must catch it or also declare throws.

throws is not the same as throw. throws declares. throw does it. You can list many types after throws.

RuntimeException usually is not declared. Checked exceptions are.

Let's take this on the board with one tiny Main class — no extra files. Java throws Keyword — 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 throws Keyword.

Exam tip

Say: throws is the warning on the method. throw is the actual throw inside.

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 throws Keyword — final, boolean, if, true are keywords used with normal meaning.

Short notes

  • Defthrows = declare a checked exception on the method signature.
  • RuleCaller must catch or also declare throws.
  • Diffthrow does it. throws declares it.
  • RememberCan list many types. RuntimeException usually not declared.

Questions

1

Where do you write throws?

2

throw vs throws?

Previous← Exception Propagation in JavaNextDifference Between throw and throws 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.