Sono un principiante in Java e sto cercando di eseguire il mio codice utilizzando IntelliJ che ho appena installato come IDE con JDK 1.7. Il seguente pezzo di codice continua non viene nemmeno compilato e continua a darmi l'errore:
Error: Could not find or load main class libTest
Codice
import java.lang.Integer;
import java.lang.String;
import java.lang.System;
import java.util.*;
class book {
private String name = "trial";
private int bookCode=1;
private int issued=0;
public void Issue(){
if(issued==0) {
issued=1;
System.out.println("You have succesfully issued the book");
}
else {
System.out.println("The book is already issued. Please contact the librarian for further details");
}
}
public int checkCode() {
return bookCode;
}
String readName() {
return name;
}
public void setName(String newName){
name=newName;
}
public void setBookCode(int newCode){
bookCode=newCode;
}
}
class library {
private ArrayList books=new ArrayList();
public void getList(){
for(int bk:books){
String bName=books(bk).readName();
System.out.println((bk+1)+") "+bName);
}
}
}
public class libTest{
public static void main(String[] args){
library newLib= new library();
System.out.println("code working");
}
}
C'è qualche cambiamento che devo fare nelle impostazioni del compilatore ?? O è il codice.
import java.lang...Ciò accade automaticamente per le classi nel langpacchetto.











libTest.java?