Home Java Java-get-example Java error java.lang.noclassdeffounderror
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Java error java.lang.noclassdeffounderror

Advertisement
The Java.lang. noclassdeffounder occurred in a code when the programmer write a wrong class name on the command prompt during the execution or running of the program.

Java error java.lang.noclassdeffounderror

     

The Java.lang. noclassdeffounder occurred in a code when the programmer write a wrong class name on the command prompt during the execution or running of the program.

Understand with Example

In this Tutorial we want to describe you a case that helps you in understanding a java.lang.noclassdeffounder.For this we have a class name 'java langnoclassdeffounder'.Inside this main class we have a main method that include -

 

 

Input Stream Reader This is used to read  a byte code that is used to decode  byte code into a  character stream
BufferStream Reader This is used to read a text character stream present in a input stream reader.
readline This is used to read a number printed on the command prompt.

On command prompt if the programmer mistakenly  write a wrong class name during the running of the program, the code display you an error i.e java langnoclassdeffounder.In this example the programmer write wrong a class name javanoclassdeffounderror1 instead of writing javalangnoclassdeffounderror.Therefore on execution the code show an error java.langnoclassdeffounderror.java.

javalangnoclassdefounderror.java
import java.io.*;
public class javalangnoclassdefounderror {
 
  public static void main(String args[]) throws Exception{
  
  InputStreamReader inputStreamReader = new InputStreamReader(System.in);
  BufferedReader br = new BufferedReader(inputStreamReader);
  
  System.out.println("Enter a number : ");
  String num= br.readLine();
 System.out.println("entered nuber is: "+num);
  }

}

Output


To solve this error you have to check wheather during compile time you have given java file name correct or not.

Download code

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 3, 2008

Related Tutorials

Ask Questions?    Discuss: Java error java.lang.noclassdeffounderror  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com