The eBay Song | Credit Cards | Mobile Phones | Anime Streaming | Loans
Execution Error in Java. Please help me!! [Archive] - PCMech Forums

PDA

View Full Version : Execution Error in Java. Please help me!!


plomon
12-04-2004, 04:56 AM
Hi there,

I wrote a simple program to display the details of a Customer like this :

_________________________________________________________________

import java.lang.*;
public class Customer
{
String custname;
String custID;

public Customer()
{
custname = "Bob";
custID = "S20010";
}

public void displaydetails()
{

System.out.println("Customer name is " + custname);
System.out.println("Customer ID is " + custID);

}

public static void main(String a[])
{

Customer cust = new Customer();
cust.displaydetails();
}

}
_________________________________________________________________

The compilation went right. But, during the execution part, the follwing error messsage was displayed :

Exception in thread "main" java.lang.NoClassDefFoundError: Customer/java

Please help me sove the problem!! :)

Karthik1019
12-04-2004, 08:53 AM
hmmmm.....strange, your exact code compiled and ran fine on my computer. But maybe you're using different software. Would splitting it up into two classes work better?