tg-me.com/topJavaQuizExplain/33
Create:
Last Update:
Last Update:
Given the following class, which of the following calls print out Blue Jay?
public class BirdDisplay {
public static void main(String[] name) {
System.out.println(name[1]);
} }
❌ A. java BirdDisplay Sparrow Blue Jay
✅ B. java BirdDisplay Sparrow "Blue Jay"
❌ C. java BirdDisplay Blue Jay Sparrow
❌ D. java BirdDisplay "Blue Jay" Sparrow
❌ E. java BirdDisplay.class Sparrow "Blue Jay"
❌ F. java BirdDisplay.class "Blue Jay" Sparrow
❌ G. Does not compile
Explanation:
Option B is correct because arrays start counting from zero and strings with spaces must be in quotes. Option A is incorrect because it outputs Blue. C is incorrect because it outputs Jay. Option D is incorrect because it outputs Sparrow. Options E and F are incorrect because they output Error: Could not find or load main class BirdDisplay.class.
BY Explanations “Top Java Quiz Questions”
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/topJavaQuizExplain/33