Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Tasks2;
- import java.util.Arrays;
- import java.lang.String;
- public class ArrayInt {
- public static void main(String[] args) {
- int[] arr = {2, 4, 5, 6, 8};
- int a = 2;
- boolean c = false;
- for (int i = 0; i < arr.length; i++) {
- if (a == arr[i]) {
- c = true;
- }
- System.out.println(c);
- break;
- }
- }
- }
Add Comment
Please, Sign In to add comment