---
title: "Difference between noclassdeffounderror and classnotfoundexception?"  
description: "Difference between noclassdeffounderror and classnotfoundexception?"  
author: "Anonymous User"  
published: 2015-09-02  
updated: 2020-09-19  
canonical: https://www.mindstick.com/interview/22798/difference-between-noclassdeffounderror-and-classnotfoundexception  
category: "java"  
tags: ["exception handling", "java", "error"]  
reading_time: 1 minute  

---

# Difference between noclassdeffounderror and classnotfoundexception?

java.lang.NoClassDefFoundError occurs when a particular class was present during Compile time but not available during run time by any reason, while java.lang.ClassNotFoundException comes when class loaded explicitly during runtime.

## Answers

### Answer by Anonymous User

java.lang.NoClassDefFoundError occurs when a particular class was present during Compile time but not available during run time by any reason, while java.lang.ClassNotFoundException comes when class loaded explicitly during runtime.


---

Original Source: https://www.mindstick.com/interview/22798/difference-between-noclassdeffounderror-and-classnotfoundexception

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
