Question: I am trying to make a **checkbox** smaller and change the size of border

I have tried playing around with layout in XML and `.width()`or `.height` in Kotlin. Neither does anything to change the size of it. I went to the tutorial that was recommended to others that asked these questions, but I did not understand what he did.
 Any suggestions?

**mycheckbox.xml**

```
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:gravity="center"
   android:orientation="horizontal">

```

```
  android:id="@+id/stSafeCheck"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:button="@drawable/my_checkbox" />

```

**my\_checkbox.xml**

```
<item
        android:state_checked="false"
        android:drawable="@drawable/checkbox_off_background"/>

<item

        android:state_checked="true"
        android:drawable="@drawable/checkbox_on_background"/>

```

**checkbox\_off\_background**

```
<item>
    <shape android:shape="rectangle">
        <size
                android:width="25dp"
                android:height="25dp" />
    </shape>
</item>

<item android:drawable="@android:drawable/checkbox_off_background" />

```

**checkbox\_on\_background.xml**

```
<item>
    <shape android:shape="rectangle">
        <size
                android:width="25dp"
                android:height="25dp" />
    </shape>
</item>

<item android:drawable="@android:drawable/checkbox_on_background" />

```

Answer: 
This can be simplified a bit, no need to keep an array:

```
public class HighestMark {

  private static final int MAX_INPUT = 6; // could just hard-code this in loop, but good practice to set constants

  private static final Scanner SCAN = new Scanner(System.in);

  public static void main(String[] args) {
    int highest = 0;
    for (int i = 0; i < MAX_INPUT; i++) {
      int next = SCAN.nextInt();
      if (next < 0) { // validate the input (require non-negative int)
        System.out.println("appropriate error message...");
        break;
      }
      if (next > highest) {
        highest = next;
      }
    }
    System.out.println("Highest mark is " + highest);
  }

}

```
You need a boolean flag.

Set the flag to false, when there is any negative number.

Check the flag before checking max number.

```
Scanner sc = new Scanner(System.in);
int a[] = new int[6];
boolean flag = true;

for (int i = 0; i < a.length; i++) {
    a[i] = sc.nextInt(); // To exit loop
    if (a[i] < 0) {
        System.out.println("Invalid Mark");
        flag = false;
        break;//return; //System.exit(0); any of these 3 will work fine.
    }
}
if (flag) {
    int max = a[0];
    for (int i = 1; i < a.length; i++) // To find highest
    {
        if (max < a[i])
            max = a[i];
    }

    System.out.println("Highest Mark is" + max);
}

```