1、杭州天丽科技有限公司JAVA高级程序员选择题1:1.What will be the result of executing the following code? 2. boolean a = true; 3. boolean b = false; 4. boolean c = true; 5. if (a == true) 6. if (b == true) 7. if (c == true) System.out.println("Some things are true in this world"
2、); 8. else System.out.println("Nothing is true in this world!"); 9. else if (a && (b = c)) System.out.println("It's too confusing to tell what is true and what is false"); 10. else System.out.println("Hey this won't compile"); 11. 12.Choices: Whatw
5、agecollectionoftheJVMpreventsprogramsfromeverrunningoutofmemoryB.AprogramcansuggestthatgarbagecollectionbeperformedandforceitC.GarbagecollectionisplatformindependentD.Anobjectbecomeseligibleforgarbagecollectionwhenallreferencesdenotingitaresettonull.3:1.What will ha
6、ppen when you attempt to compile and run the following code? 2. 3.class Base 4. 1.{ 2. 3.int i = 99; 4. 5.public void amethod() 6. 7.{ 8. 9. System.out.println("Base.amethod()"); 10. 11. } 12. 13. Base() 14. 15.{ 16. 17. amet
7、hod(); 18. 19. } 20. 21.} 22. 23.public class Derived extends Base 24. 25.{ 26. 27.int i = -1; 28. 29. 30. 31.public static void main(String argv[]) 32. 33.{ 34. 35. Base b = new Derived(); 36. 37. System.out.println(b.i);