プロジェクトを NetBeans で実行する際に問題があります。
これはパスの問題だと思います。以前に他のプロジェクトで修正しましたが、まだ混乱しています。
これは私が持っているコードです
public class TestStack
{
public static void main(String[] args)
{
double[] dblElements = {1.1, 2.2, 3.3, 4.4, 5.5};
int[] intElements = {1,2,3,4,5,6,7,8,9,10};
// Create a staqck of doubles & a stack of ints
Stack<Double> dStack = new Stack<Double>(5);
Stack<Integer> iStack = new Stack<Integer>();
// push elements onto the stack
PushDouble(dStack, dblElements);
PopDouble(dStack);
}
private static void PushInteger(Stack<Integer> stack, int[] values)
{
System.out.println("\nPushing elements onto stack of integers");
for (int i : values)
{
System.out.printf("%.1f ", i);
stack.push(i);
}
}
private static void PopInteger(Stack<Integer> stack)
{
try
{
System.out.println("\nPopping elements from stack of integers");
double value;
// Remove all elements from stack & display them
while(true)
{
value = stack.pop();
System.out.printf("%.1f ",value);
}
} // end of try block
catch(EmptyStackException E)
{
System.err.println();
E.printStackTrace();
} // end of catch block
}
private static void PushDouble(Stack<Double> stack, double[] values)
{
System.out.println("\nPushing elements onto stack of doubles");
for (double d : values)
{
System.out.printf("%.1f ", d);
stack.push(d);
}
}
private static void PopDouble(Stack<Double> stack)
{
try
{
System.out.println("\nPopping elements from stack of doubles");
double value;
// Remove all elements from stack & display them
while(true)
{
value = stack.pop();
System.out.printf("%.1f ",value);
}
} // end of try block
catch(EmptyStackException E)
{
System.err.println();
E.printStackTrace();
} // end of catch block
}
}
そして、私のエラーは...
Error: Could not find or load main class teststack.TestStack
私は何をすべきか?