The correct answer is AC, I will explain:
B -> You can't put a for loop outside the main method
D -> This one is very wrong, you can only declare the package in the first line of code
E -> This one is as wrong as the letter D, you can only import one package before instantiating the class and if you have a package declared, the declaration can only be made between it and the class declaration, anything outside of that is wrong
Correct answer is A and C
You can't declare a for loop outside main method
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.
ShaileshRaj
3 months, 1 week agoDriftKing
4 months, 3 weeks agodsms
4 months, 4 weeks agoakbiyik
1 year, 1 month agoiSnover
1 year, 3 months agoshivkumarx
1 year, 4 months ago