"Exception in thread "main" java.lang.NoSuchMethodError: main"
i have tried to run the below code, but " Exception in thread "main" java.lang.NoSuchMethodError: main" is the error i am getting, could anyone help me
Quote:
class Book
{
String title;
String author;
float price;
void giveDatatoBook(String t,String a,float p)
{
title=t;
author=a;
price=p;
}
void displayBookDetails()
{
System.out.println("Book Title:"+title);
System.out.println("Author of the Book:"+author);
System.out.println("Book Price :"+price);
}
}
class ExecuteBook
{
public static void main(String[] args)
{
Book b1= new Book();
b1.giveDatatoBook("can love happen twice","ravinde singh",199);
b1.displayBookDetails();
}
}
Re: "Exception in thread "main" java.lang.NoSuchMethodError: main"
How exactly are you compiling and running this?
Re: "Exception in thread "main" java.lang.NoSuchMethodError: main"