Java
T
point
Home
Python
Java
JavaScript
HTML
SQL
PHP
C#
C++
DS
Aptitude
Reasoning
Selenium
DBMS
C
Android
Interview Q
Content Menu ▼
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Question 1
:
package com.sun.scjp;
public class Geodetics {
public static final double DIAMETER = 12756.32; // kilometers
}
Which one correctly access the DIAMETER member of the Geodetics class?
1.
import com.sun.scjp.Geodetics;
public class TerraCarta {
public double halfway()
{ return Geodetics.DIAMETER/2.0; }
2.
import static com.sun.scjp.Geodetics;
public class TerraCarta{
public double halfway() { return DIAMETER/2.0; } }
3.
package com.sun.scjp;
public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } }