Java: how to have try-catch as conditional in for-loop?
- by HH
I know how to solve the problem by comparing size to an upper bound but I want a conditional that look for an exception. If an exception occur in conditinal, I want to exit.
import java.io.*;
import java.util.*;
public class listTest{
public static void main(String[] args){
Stack<Integer> numbs=new…