Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Great share. Thanks a lot! My score: 1/2. I could not answer Long prob right.
- Rishi Raj
Crystal Clear Explanation! but in the second case you converted the value to boolean, how can we achieve it in a min, any shortcuts?
- Shiva
Answer to question 1 is wrong. Kindly correct. public class NullArgumentTest { public static void main(String[] args) { method(null); } public static void method(Object o){ System.out.println(“Object imple”+o); System.out.println(“test”); } public static void method(String s){ System.out.println(“object impl”+ s); } } /*****Output*******/ object implnull So, Kindly reply.
- Karam
In my interview with Chetu India, there was one simple question which made me think twice: public class HelloWorld { public static void main(String args[]){ boolean a = false; if(a=true){ System.out.println("a is true"); }else{ System.out.println("a is false"); } } } So, i hope this would help someone.
- Karam
public class HelloWorld { public static void main(String args[]){ boolean a = false; if(a=true){ System.out.println(“a is true”); }else{ System.out.println(“a is false”); } } } No one can prove this is an incorrect question. In the if part you are first assigning a is to true & then the if condition will be examined & it is found true.
- Harsh Rasogi
public static void main(String[] args) { method(null); } public static void method(Object o) { System.out.println(“Object impl”); } public static void method(int s) { System.out.println(“Integer impl”); } public static void method(String s) { System.out.println(“String impl”); } could you explain to my Why the System print “String impl”. I couldn’t no understand it. I am sorry ab this silly question. bcoz im noob on java. Many thank.
- Logan
public class Test { public static void main(String args[]) { nullCheck(null); } public static void nullCheck(String s) { System.out.println(“string”); } public static void nullCheck(Object s) { System.out.println(“object”); } } //output String can anyone explain to me why out is String?
- Rajesh pawar
I think your explanation of question 2 is not complete, you don’t make it clear that the L modifies only the constant 365… The multiplications are executed left to right, so in the first line of the example 1000*60*60*24 is computed in 32-bit arithmetic (it fits). The last operation multiplies that result by a long (365L) which forces the promotion to 64 bit. Observe: jshell> 1000*60*60*24 $4 ==> 86400000 jshell> 1000*60*60*24*365L $5 ==> 31536000000 jshell> 1000*60*60*24*365*1L $6 ==> 1471228928 jshell> 1000*60*60*24*365 $7 ==> 1471228928
- Chuck