ho scritto una classe che ha due file di testo in ingresso e copia due sottostringhe di un file nell'altro.
quando lo eseguo mi dice che non reisce a trovare la classe main.
non sono molto esperto...ma non ne capisco il perché
chi mi dà una mano?
codice:import java.io.*; class instanceCreator { private BufferedReader inRdf; private BufferedWriter outRdf; instanceCreator (String inFile, String outFile){ try { inRdf = new BufferedReader(new FileReader(inFile)); outRdf = new BufferedWriter(new FileWriter(outFile)); } catch(IOException e) {e.printStackTrace();} } //Metodo complete void complete() { try{ String inputLine = inRdf.readLine(); int beginInd = 0; int apartInd = inputLine.indexOf("@"); int vdoInd = apartInd+1; String ns = inputLine.substring(beginInd, apartInd); String vdo = inputLine.substring(vdoInd); outRdf.write(ns); CharSequence csq = vdo; outRdf.append(csq); inRdf.close(); outRdf.close(); outRdf.flush(); } catch(IOException e) {e.printStackTrace();} } class testInstance { public void main(String[] args) throws IOException { if(args.length != 2) { System.out.println("Please enter <inFile>, <outFile>"); System.exit(1); } instanceCreator fileRDF = new instanceCreator(args[0],args[1]); fileRDF.complete(); } } }

Rispondi quotando