Finding the percentage of even numbers in an array
Potential bug: What if the array contains a single element, and it is even?

if(a.length &lt;= 1) {
    return 0.0;
}


That's what happens.

Easy fix, change to:

if(a.length == 0) {




Your indentation is slightly screwed up, but that might just be a copy-paste error.



double even should be int even.



You could use a for-each loop,

for (int i : a) {
    if(i % 2 == 0) {




int[] a could be named int[] array or int[] values or int[] input.



When using even as an int, use the following return statement to cast only even to a double, which will then make it use double division and not int division:

return (double) even / a.length * 100;


Alternatively you could use:

return even * 100.0 / a.length;


But I think return (double) even / a.length * 100; is better.