Explain Global variables in Packages?

Answers were Sorted based on User's Feedback



Explain Global variables in Packages?..

Answer / milind

i think der is no such thing global variable in java....
instance variable
local vaiable is in java

Is This Answer Correct ?    0 Yes 0 No

Explain Global variables in Packages?..

Answer / preetesh

There is no term as Global variable in Java.
Types of variable: 1) Local Variable declared within method.
2) Instance Variable declared within class but outside
method.
3) Class Variable
4) Parameters are also treated as variables

Example:
--------
public class Global {
public static int i = 25;
public static String s = "Preetesh";
}

//Such members can be accessed as:

public class Test {
public static void main(String[] args)
{
Global.i = Global.i + 100;
Global.s = "Java";
}
}

Is This Answer Correct ?    0 Yes 0 No

Explain Global variables in Packages?..

Answer / therathna

for what package r u asking

there is no meaning for Global variables in Packages

Is This Answer Correct ?    0 Yes 1 No

Explain Global variables in Packages?..

Answer / anitha

expect private,all public,protected and default variables
are global in a package

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

Differentiate jar and war files?

0 Answers  


What is string in java? String is a data type?

0 Answers  


What is difference between Eclips and MyEclips?

3 Answers  


What is abstraction with strong example program? (not a general program)

3 Answers  


Lowest Common ancestor in a Binary Search Tree and Binary Tree.

0 Answers   Amazon,






When you declare a method as abstract method ?

2 Answers   HP,


adapter class ?

2 Answers  


What is object data type?

0 Answers  


why ,we are using jsp and html.which one is better?

2 Answers   Photon,


What is the covariant return type?

0 Answers  


Explain the reason behind ending a program with a system.exit(0)?

0 Answers  


What is local declaration?

0 Answers  


Categories