dcsimg
error in eclipse while running stack java code.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   VENKATESH_LANKE
Posted On:   Thursday, February 14, 2008 02:57 AM

Hi all, I was trying java stack program on eclipse which is as follows. // Stack.java: stack implementation public class Stack { private int maxStack; private int emptyStack; private int top; private char[] items; public Stack(int size) { maxStack= size; emptyStack = -1; top = emptyStack; items = new char[maxStack]; } public void push(char c) { items[++top] = c; } public char pop() { return items[top--]; } public boolean full() { return top + 1 == maxStack; } public boolean empty() { return top == emptyStack;    More>>

Hi all,


I was trying java stack program on eclipse which is as follows.

			
// Stack.java: stack implementation
public class Stack {
private int maxStack;
private int emptyStack;
private int top;
private char[] items;

public Stack(int size) {
maxStack= size;
emptyStack = -1;
top = emptyStack;
items = new char[maxStack];
}


public void push(char c) {
items[++top] = c;
}

public char pop() {
return items[top--];
}

public boolean full() {
return top + 1 == maxStack;
}

public boolean empty() {
return top == emptyStack;
}
}
// Stackmain.java: use the stack
import java.io.*;
public class Stackmain {

public static void main(String[] args)
throws IOException {
Stack s = new Stack(10); // 10 chars
char ch;
while ((ch = (char)System.in.read())
!= '
')
if (!s.full()) s.push(ch);
while (!s.empty())
System.out.print(s.pop());
System.out.println();
}
}


once i tried to run the program I didnt get anything on console. When i tried to debug it intializing a breakpoint I got an error in a new window
Source not found Launcher$AppClassLoader(ClassLoader).loadClassInternal(String)
and debugging stopped.
I also got an option for edit source lookup path .I dont know wat does it mean.
Can anyone suggest me some steps to troubleshoot.


Thanks in advance.    <<Less

Re: error in eclipse while running stack java code.

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, February 16, 2008 07:50 PM

It means, in order for you to see the source code so you can see what line you're on etc., you have to tell Eclipse the location of the source code, for each class that you might be stepping through.



If it's not a class that you care about, then just keep going and step until you get to a class that you DO care about.
About | Sitemap | Contact