- Dec 9, 2000
- 16,528
- 4
- 0
MemoryManager.java:166: unreported exception InsufficientMemory; must be caught or declared to be thrown
M.request(50);
I keep getting that message when I try to run my program. It's supposed to throw an Insufficient Memory exception when it requests a block of memory too big...
public int request(int n) throws InsufficientMemory
if (too big)
throw new InsufficientMemory();
public class InsufficientMemory extends Exception
{
public InsufficientMemory()
{
}
public InsufficientMemory(String message)
{
super(message);
}
}
whats wrong with that?
M.request(50);
I keep getting that message when I try to run my program. It's supposed to throw an Insufficient Memory exception when it requests a block of memory too big...
public int request(int n) throws InsufficientMemory
if (too big)
throw new InsufficientMemory();
public class InsufficientMemory extends Exception
{
public InsufficientMemory()
{
}
public InsufficientMemory(String message)
{
super(message);
}
}
whats wrong with that?