Originally posted by Mathias P.W Nilsson:
Great score Haining! I'm up in about 2 weeks. I must say I'm still week on Threads and io. Did you just read Khaild's book and RHE or do you have other suggestions?
Originally posted by Ashik uzzaman:
Congrats Haining! Great score!!
How many questions were on I/O and how much time did u take? Did u use JQ+/J@Whiz?
Originally posted by anand raman:
the answer will not be affected by just changing the data type of the variable a. As i understand it, the return type of ternary operator is determined by the types of the true and false option. The return type will be determined by the larger option.
Originally posted by Thomas Paul:
The JLS explains it here:
http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#9208
The problem is that you are attempting to store an infinitely long number (1/49) within a fixed length field. This is obviously impossible. Rounding/truncation has to occur on the fraction. So when you multiply (1/49) * 49 you do not get 1.
Originally posted by Jyotsna Umesh:
Q. If you compile the following code what will be the result?
public class MyClass {
public static void main(String args[]) {
String str1 = "Test One";
String str2 = new String("Test One");
if ( str1.equals( str2) ) {
System.out.println("Both are equal");
}
boolean b = true;
boolean b1 = false;
if ( b.equals(b1) ) {
System.out.println("true");
}
}
}
[a] Compile time error
[b] Runtime error.
[c] No output
[d] "Both are equal" followed by "true"