Question: In java, how to check if a list have the same element in a list? String[] keywordsArray = { IF, WRITE, READ, RETURN, BEGIN, END,

In java, how to check if a list have the same element in a list?

String[] keywordsArray = { "IF", "WRITE", "READ", "RETURN", "BEGIN", "END", "MAIN"}; Set keywords = new HashSet(); for (String s : keywordsArray) {; keywords.add(s); }

String token="BACK";

i want to check if the token is in the keyworks list, but i dont know how, how to do that?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!