java - Error:Could not find or load main -
it gives me error when launch, class name aqueueclass help?
package `com.thekyle.hi;` class qdemo { // queue class characters char q[]; // array holds queue int putloc, getloc; // put , indices qdemo(int size) { q = new char[size + 1]; putloc = getloc = 0; }// put character queue void put(char ch) { if (putloc == q.length - 1) { system.out.println(" - queue full silly- "); return; } putloc++; q[putloc] = ch; } char get() {// gets character queue if (getloc == putloc) { system.out.println(" queue empty"); return (char) 0; } getloc++; return q[getloc]; } } class aqueueclass { public static void main(string args[]) { qdemo bigq = new qdemo(100); qdemo smallq = new qdemo(4); char ch; int i; system.out.println("using bigq store alphabet"); (i = 0; < 26; i++) { bigq.put((char) ('a' + i)); // retrieve , display elements bigq system.out.println("contents of bigq: "); (i = 0; < 26; i++) { ch = bigq.get(); if (ch != (char) 0) system.out.print(ch); } system.out.println("\n"); system.out.println("using small q generate errors"); (i = 0; < 5; i++) { system.out.print("attemting store " + (char) ('z' - i)); smallq.put((char)('z' - i)); system.out.println(); } system.out.println(); system.out.println("contents of smallq: "); (i = 0; < 5; i++) { ch = smallq.get(); if( ch != (char) 0 ) system.out.print(ch); } } } }
if class path problem, find class path? , since says need more detail, here filler.
by name have save java file. if have 2 class in java file try made class containing main() method public class.
Comments
Post a Comment