Long before I've started to develop something essential on Java, this language invoked very contradicting thoughts in my mind.
Now when I delved deeper into Java, I realize how many peculiarities in Java are actually different: Java has larger heritage from C++ then C#.
In practice you can try to evaluate this code in both languages:
String a = "Falafel";
String c = "fel";
String b = "Fala" + c;
System.out.println(a == b);
In C# you'll have to use System.Console.WriteLine instead of System.out.println
In Java you'll get false, while in C# you'll get true. Why? Simply because Java compares addresses of a and b, while .Net compares content. You should use equals (before 1.6) and StringUtils (since 1.6) in Java to compare strings correctly.
How about casting? Have you ever tried evaluate this expression
Experienced Java developers will answer: (byte)-1 will cause overflow, so you might expect something like 65535 on the very end. C# gets obviously the same answer, but by default C# compiler refrains to compile such a mess. You'll be kindly asked to use unchecked option on your own risk:
int i = (int)(char)(byte)-1
Working with numbers is very messy in Java (I will keep using references whenever I worked with arithmetic operations
Hex number 0xfa1afe11 will output positive result in C#, but negative in Java. The reason is that hex number with leading 1 treat as negative.
Floats can also challenge you: Java expression
System.out.println(2 - 1.1);
while in C#
Console.WriteLine(2 - 1.1);
NB: I must admit, that in .Net trouble with floating point operations are not finally resolved (MathLab and Maple in any case do them better)
Java has special class BigDecimal to perform operations with additional precision or value, but you might be careful using them either. Don't you know what is the difference between two following expressions in Java
BigDecimal dec1 = new BigDecimal(.1);
BigDecimal dec2 = new BigDecimal(".1");
Can't you guess?
Oh, you might be surprised that first one will output huge ugly number
Gurus highly recommend to use constructor BigDecimal(String) and not convert primitives to BigDecimal directly
Expressions like i = i + k; and i += k; are not equivalent in Java, although many Java developers think they are.
In any case my way in Java has just begun and it will take couples month until I will be able to cause another overproduction crisis in IT ...