Which of the following are true? (Choose all that apply)
4: short myValue = 5;
5: int myValue2 = 1.2;
6: String myValue3 = "java2s.com";
7: myValue.length();
8: myValue2.length();
9: myValue3.length();
B, D, E.
A compiles because short is an integral type.
B generates a compiler error because int is an integral type, but 1.2 is a floating-point type.
C compiles because it is assigned a String.
D and E do not compile because short and int are primitives. Primitives do not allow methods to be called on them.
F compiles because length() is defined on String class.