|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (5 bit)
Join Date: Dec 2004
Posts: 16
|
Execution Error in Java. Please help me!!
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!!
|
|
|
|
|
|
#2 |
|
Member (8 bit)
Join Date: Jun 2004
Location: La Jolla, CA
Posts: 190
|
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?
__________________
Aspire X-Dreamer II (Black) ATX Case | Intel D865PERLL Motherboard | Intel P4/ 3.0CGHz w/ HT 800MHz FSB CPU | Enlight 420w PSU | ADATA Dual 512MB PC3200 DDR | Samsung 120GB SATA Hard Drive | 8X Pioneer DVD+/-RW Drive | Samsung 16X DVD-ROM Drive | NEC Int Floppy Drive | ATI Radeon 9600XT 128MB 128-bit Video Card | ATI TV Wonder Pro | Logitech Cordless Comfort Duo | Creative Labs Audigy LS | Logitech Z640 5.1 Speakers | Samsung 170N (Black) 17" Flat Panel |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|