Login    Forum    Search    FAQ   Blog

Board index » Server Side Development » Java




 Page 1 of 1 [ 6 posts ] 



Author Message
 Post subject: What is diff when using import statement wid the static key
 Post Posted: Fri Nov 27, 2009 8:21 pm 
Offline

Joined: Sat Feb 21, 2009 2:29 pm
Posts: 67
Code:
   
10. package com.sun.scjp;
11. public class Geodetics {
12. public static final double DIAMETER = 12756.32; // kilometers
13. }
Which two correctly access the DIAMETER member of the Geodetics class? (Choose two.)
A. import com.sun.scjp.Geodetics;
public class TerraCarta {
public double halfway()
{ return Geodetics.DIAMETER/2.0; }
B. import static com.sun.scjp.Geodetics;
public class TerraCarta{
public double halfway() { return DIAMETER/2.0; } }
C. import static com.sun.scjp.Geodetics.*;
public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } }
D. package com.sun.scjp;
public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } }


The perrfect ans is A,C.I understood how A was da answer , howevr could
anyone explain me abt the package import usin the static keyword.The
above exp could be used just as the reference.

Thanks a lot 4 ur consideration.


Top 
 Post subject: Re: What is diff when using import statement wid the static key
 Post Posted: Fri Nov 27, 2009 8:21 pm 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
here is the link 2 a small tutorial:
http://www.deitel.com/articles/java_tut ... index.html


Top 
 Post subject: Re: What is diff when using import statement wid the static key
 Post Posted: Fri Nov 27, 2009 8:21 pm 
Offline

Joined: Sat Feb 21, 2009 2:29 pm
Posts: 67
Got it now .Thank u scphan 4 da prompt nd accurate response.


Top 
 Post subject: Re: What is diff when using import statement wid the static key
 Post Posted: Fri Nov 27, 2009 8:22 pm 
Offline

Joined: Sat Feb 21, 2009 1:08 pm
Posts: 549
And now do u know the diff between the "import static" nd
"import"?


Top 
 Post subject: Re: What is diff when using import statement wid the static key
 Post Posted: Fri Nov 27, 2009 8:22 pm 
Offline

Joined: Sat Feb 21, 2009 2:25 pm
Posts: 51
That was an easy one.
"import static" hhave "static" in it.


Top 
 Post subject: Re: What is diff when using import statement wid the static key
 Post Posted: Fri Nov 27, 2009 8:22 pm 
Offline

Joined: Sat Feb 21, 2009 2:29 pm
Posts: 67
thanks guys!!:-)


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 6 posts ] 




Board index » Server Side Development » Java


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron