This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Package  RSS feed

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a question from voodoo exam
package org . myPack ;
public class Ques01 {
// some code
};
Which of the following are valid ways of refereing to the class from any other package besides org . myPack ?
Options :
a . Refer to the class as Ques01
b . Refer to the class as org . myPack . Ques01
c . Refer to the class as myPack . Ques01
d . import org . myPack . * & then refer to the class as Ques01
e . import org . * & then refer to the class as Ques01
The ans given are b and c . I answered it as b and d.
Could anypne of you explain me the options c?
[ December 16, 2003: Message edited by: Lakshmi Saradha ]
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has just got to be a mistake. It doesn't make sense to use "c", and your answers seem correct to me
cheers,
Kathy
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I do agree that b and d are correct answers....
B is for the classes, which does not want to import the org.myPack.Ques01 at the beginning... In this case that the usage amount is less and the programmer just want to use it sometimes, the way to use Ques01 in B is reasonable...
But if the programmer wants to use the Ques01 for many times in the class, he/she should import it at the beginning of his/her class. Then he can use the Ques01 by just using "Ques01", not needed to use the whole fullpath like "org.myPack.Ques01"...
Just some more explanation from me....
 
Lakshmi Saradha
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you kathy and Ko Ko naing..

Regards,
Lakshmi.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
b , d
 
Without subsidies, chem-ag food costs four times more than organic. Or this 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!