E is the only correct answer, as it provides one member variable "private String name" and one method "public void display".
D is not correct. It may look correct because of the member "private int num" but it's code enclosed in curly braces. There is no possibility to just dump a code block inside a class definition. It's a random code block containing "private int num", which is not correct itself also.
B is wrong because you can't declare package inside the class statement. D is correct because you can declare local variables inside a class statement, like methods (so E answer is correct aswell).
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
electri
4 weeks agokrysitian
3 months, 4 weeks agotabrezshaikh13
12 months agofalchetto
1 year, 2 months agoOlha88
1 year, 3 months agoyonathanmartinez
1 year, 7 months ago