FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Compile-Time and Runtime Exceptions
NewsMachine Learning

Compile-Time and Runtime Exceptions

via Dev.to TutorialArun Kumar4h ago

In Java, exceptions are mainly divided into two types: Compile-Time Exceptions (Checked Exceptions) Runtime Exceptions (Unchecked Exceptions) What is a Compile-Time Exception? A Compile-Time Exception (also called a Checked Exception) is an error that is detected during compilation. The compiler checks these exceptions before the program runs. Examples: IOException SQLException FileNotFoundException Example Program: import java.io.* ; class Test { public static void main ( String [] args ) { FileReader file = new FileReader ( "test.txt" ); // Compile-time error } } Correct Way: import java.io.* ; class Test { public static void main ( String [] args ) { try { FileReader file = new FileReader ( "test.txt" ); } catch ( FileNotFoundException e ) { System . out . println ( "File not found" ); } } } What is a Runtime Exception? A Runtime Exception (also called an Unchecked Exception) occurs while the program is running. Examples: ArithmeticException NullPointerException ArrayIndexOutOfBound

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
3 views

Related Articles

Deep Dive into Functions: dir(), pip, Default Args, *args, **kwargs, Type Hints, Positional/Keyword…
News

Deep Dive into Functions: dir(), pip, Default Args, *args, **kwargs, Type Hints, Positional/Keyword…

Medium Programming • 4h ago

Stop Writing Clever Code
News

Stop Writing Clever Code

Medium Programming • 4h ago

Anthropic’s Claude Code Source Code Leaked: The npm .map Blunder That Exposed Everything
News

Anthropic’s Claude Code Source Code Leaked: The npm .map Blunder That Exposed Everything

Medium Programming • 4h ago

Amazon Spring Sale live blog 2026: Last day to score top deals
News

Amazon Spring Sale live blog 2026: Last day to score top deals

ZDNet • 5h ago

Mastering Clean Code Part 6
News

Mastering Clean Code Part 6

Medium Programming • 5h ago

Discover More Articles