Q:

Determining the difference between odd and even numbers

I have code that converts each character of a String to an int and returns the difference between odd and even numbers. Can this code be simplified?
int compareSumOfDigits(String N) {
int e=0,o=0;
for (int i =0;i<N.length();i++){
    int t = Character.getNumericValue(N.charAt(i));
    if(t%2==0)
    e+=t;
else
    o+=t;

}
      return  o-e ;
}

A:

Combining some of the existing answers, you can do
s.chars()                          // get the char stream
  .map(Character::getNumericValue) // convert to ints
  .map(n -> n%2==0 ? -n : n)       // negate the even ones
  .sum()                           // sum it all up

This will give you the sum of the odds and the negative evens, which is the same as the sum of the odds minus the sum of the evens.
edit
In response to @kai, for absolute max readability, I'd probably do (pseudocode)
List<int> ints = s.chars().map(Character::getNumericValue)
Map<Boolean, List<int>> intsEven = ints.partitioningBy(n -> n%2==0)
return intsEven.get(false).sum() - intsEven.get(true).sum()

or with isEven from the other answers and not defined here
List<int> ints = s.chars().map(Character::getNumericValue)
List<int> evens = ints.filter(isEven)
List<int> odds = ints.filter(not(isEven))
return odds.sum() - evens.sum()

A:

Instead of counting two sums (of odd and even digits) and returning their difference,
you could use a single sum value,
subtracting a digit's value if it's even and adding if it's odd.
An added benefit of this approach is that you are more protected from integer overflows:
if odd and even digits are interleaved,
the two-sum approach will be much less likely to overflow.
Building on @m0nhawk's version, with further improving the variable names and a few other tidbits:
boolean isEven(int number) {
    return (number % 2) == 0;
}

int compareSumOfDigits(String numericString) {
    int sum = 0;
    for (Character ch : numericString.toCharArray()) {
        int digit = Character.getNumericValue(ch);
        if (isEven(digit)) {
            sum -= digit;
        } else {
            sum += digit;
        }
    }
    return sum;
}

Or as @tobias_k proposed,
the if-else can be flattened for a more compact form,
but this is less readable so it goes away from "simple",
and I don't recommend it, but here you go anyway:
int compareSumOfDigits(String numericString) {
    int sum = 0;
    for (Character ch : numericString.toCharArray()) {
        int digit = Character.getNumericValue(ch);
        sum += digit * (isEven(digit) ? -1 : 1);
    }
    return sum;
}

Nothing to do with simplicity,
but when playing with an implementation,
it helps to have some JUnit tests handy to verify that the code still works.
A few examples to get you started:
@Test
public void test_compareSumOfDigits_11111111() {
    assertEquals(8, compareSumOfDigits("11111111"));
}

@Test
public void test_compareSumOfDigits_22222222() {
    assertEquals(-16, compareSumOfDigits("22222222"));
}

@Test
public void test_compareSumOfDigits_12345678() {
    assertEquals(-4, compareSumOfDigits("12345678"));
}

A:

It depend on you definition of a "more simple code". From my point of view it can be extend with the next stuff:

Formatting, obviously.
Using foreach loop, instead of indexing (notice, that you use index once in the for, only to get a character), this will greatly simplify the code.
Introduce function isEven for check. Java compiler is smart enough to reduce to zero all overhead on calling this function, but from reader view it's clearer now.
Put more expressible variable names, instead of one letter. I can hardly recall any situation where it impossible to seek for a better, explanatory name.

So, my simplier code looks like this.
Boolean isEven(int number) {
    return (number % 2) == 0;
}
int compareSumOfDigits(String numbers) {
    int sumEvens = 0, sumOdds = 0;
    for (Character ch : numbers.toCharArray()) {
        int number = Character.getNumericValue(ch);
        if (isEven(number)) {
            sumEvens += number;
        } else {
            sumOdds += number;
        }
    }
    return sumOdds - sumEvens;
}

