10 Things Every Java Programmer Should Know About Ruby

C Code (Weak)

#include <stdio.h>
extern float two();
int main() {
    float x = 1.5 + two();
    printf("%f\n", x);
    printf("%d\n", x);
    return 0;
}

Java Code (Strong)

public class Main {
  public static
    void main (String args[]) {
    double x = 1.5 + Two.two();
    System.out.println(x);
  }
}

int two() { return 2; }

public class Two {
  public static int two() {
    return 2;
  }
}

Output

nan
0

Output

3.5