| Gzu521.com学习网 |
|
answers answer to question 1) 1) float f=1/3; {FYa SC.(资/料来.源,于:gzu521学;习/网:IT认证;其它认证 ]gzu521.com{FYa SC. the fact that option 3 does not compile may be a surprise. the problem is because the default type for a number with a decimal component is a double and not a float. the additional trailing d in the option with 999 doesn't help, but it doesn't harm. answer to question 2) 2) new the option null (note the upper case letter) is definitely not a keyword. there is some discussion as to i. there is some discussion as to if null is a keyword but for the purpose of the exam you should probably assume it is a keyword. the option instanceof is a bit of a misleading option that would probably not occur on the exam. the real keyword is instanceof (note that the of has no capital letter o). i had the incorrect version in an earlier version of this tutorial as it looks more likely to my eyes. the instanceof keyword looks like a method, but it is actually an operator. the option wend is probably valid in some other language to indicate the end of a while loop, but java has no such keyword. answer to question 3) 1) system.out.println(1+1); string s="on"+'one'; will not compile. option 4 will not compile because 255 is out of the range of a byte answer to question 4) 1) the garbage collection algorithm in java is vendor implemented threading and garbage collection are two of the few areas that are platform dependent. this is one of the answer to question 5) (not on the official sub objectives but this topic does come up on the exam) 2) the randomaccessfile class allows you to move directly to any point a file. the file class can be considered to represent information about a file rather than a real file object. you can create a file in the underlying operating system by passing an instance of a file to a stream such as fileoutputstream. the file will be created when you call the close method of the stream. |
责任编辑:gzu521