• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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
Rancher
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!