129k views
0 votes
Is the following code legal? If not, why? TvShow.setActor1(“Jimmy Stewart”);

User Dale Ryan
by
9.2k points

1 Answer

5 votes
Answer: It was written in the question the following: static public char ch = // wrong! The word "public" must come before "static", and since this is not the case here, the above statement is NOT a legal declaration of a class variable. public static char ch =; //
User Dan Wagner
by
8.6k points