I\'m working on a project that has me create a method to check a textifle for mi
ID: 3533645 • Letter: I
Question
I'm working on a project that has me create a method to check a textifle for missing curly braces.
for example:
the program opens a textfile and checks to see if it has any curly braces, if not then return a statement. The method must be able to accept an arrayList.
java.util.Scanner();
public class braces
{
public static main void (strings [] args)
{
//System.out.println("Enter a text:");
//Scanner keyboard = new Scanner();
//System.out.println("The missing brackets:" + brackets);
}
public void brackets
{
// ArrayList<braces> brackets = new ArrayList<braces>();
for ( i = 0; i < array; i++)
if (a[i] == '{'||a[i] == '}')
return brackets;
else
System.out.println("Error ");
}
}
Explanation / Answer
already have a working program that uses this :)