A
A
Alexey4d2015-07-30 23:59:19
Java
Alexey4d, 2015-07-30 23:59:19

How to iterate over a string array?

Good evening.
There is a code:

public static void ChecktoCheat(){
    
    String[] cheats = {"de.Kradxn.Xray", "Sunstrike"};	
    Package Check = Package.getPackage(null);
    
    for(Check: cheats)
        if(Check != null) {
            System.exit(0);
        }
  }

There is no way to iterate through all the lines from the array by equating the string from the array to the Package.getPackage() method.
I hope you help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2015-07-31
@onepavel

String[] cheats = {"de.Kradxn.Xray", "Sunstrike"};	
Package Check = Package.getPackage(null);
for (String item: cheats)
    if (Check != null && Check.equals(item)) {
        System.exit(0);
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question