Win a copy of Java XML & JSON this week in the XML and Related Technologies forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Java building blocks  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii everyone ^_^,

Given the following class, which of the following calls print out Blue Jay and why?



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.

Many thanks,
 
Saloon Keeper
Posts: 5219
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's very easy to test, is it not?
 
Marshal
Posts: 62803
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Manar Katih wrote:Hii everyone ^_^, . . . ,

Welcome to the Ranch

Please always tell us where such code comes from, to reduce problems with copyright. I shall give you a hint: look in the Java™ Tutorials.
 
Manar Katih
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:That's very easy to test, is it not?


Thank you for your intervention,
i know that B is the correct answer
i mean why B apply ?
(by the way i mentionned "Beginning Java")
 
Manar Katih
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Manar Katih wrote:Hii everyone ^_^, . . . ,

Welcome to the Ranch

Please always tell us where such code comes from, to reduce problems with copyright. I shall give you a hint: look in the Java™ Tutorials.



ouups i'm sorry i didn't mean it
Thanks a lot for your help
 
Campbell Ritchie
Marshal
Posts: 62803
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Manar Katih wrote:. . . i mean why B apply ? . . .

Didn't the Java™ Tutorials link I gave you help?
 
Manar Katih
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Manar Katih wrote:. . . i mean why B apply ? . . .

Didn't the Java™ Tutorials link I gave you help?


Yeah that's helpful !
thank you
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!