viewing paste Unknown #27588 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Here is a class and some static members:
 
class Student
{
   static public final int SORT_BY_FIRST = 88;
   static public final int SORT_BY_LAST = 98;
   static public final int SORT_BY_POINTS = 108;
   
   static private int sortKey = 88;
 
   // ... etc.
};
Check the true statements (there may be more than one):
 
    A.  The initial sortKey is SORT_BY_POINTS
    B.  If a programmer changes the first three final initializations from 88, 98, 108 to 0, 1, 2, but makes no other change, the program will have a logic error.
    C.  Assuming everything else is correct, a program using the code above will run perfectly but is not making maximum use of the three symbolic constants defined.
    D.  The program will not run correctly because a literal is used to initialize sortKey.
    E.  If a programmer changes the first three final initializations from 88, 98, 108 to 0, 1, 2, but makes no other change, the program will have a compiler error.
    F.  The initial sortKey is SORT_BY_LAST
    G.  The initial sortKey is SORT_BY_FIRST
Viewed 812 times, submitted by Guest.