answersLogoWhite

0

In the case of variables, the two can be combined. This occurs, for example, with the fields Math.PI and Math.E.

I am not sure about methods, but I see no reason why you shouldn't be able to combine the two in this case.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Why use static?

Static is a keyword which is used to call the methods or variables without creation of that class object. It will directly calls the respective method and varialbles.


Are static variable created by giving keyword static in java?

yes bcoz static variables


How do you access the static variable and static methods of a class?

In java we access static variables and static methods without creating objects. i.e.,we can access directly by using classname we can also access static variables and static methods by using objects which are created by using class where the static variables and static methods are available


Which keyword is used with variables to keep them permanently within the functions?

static


Can non static methods can access static variables?

Yes, they can


It is perfectly legal to any instance variable inside of a static method?

No. You will get compilation errors. The complier will complain that you are trying to access non static variables from inside a static method. A static method can access only static variables.


Can a static method access instance variables?

Variables cannot access variables; only methods can access variables. Non-static methods (also known as instance methods) are local to an object of the class and therefore have access to a "this" reference (referring to the current instance of the class, the object upon which the method was invoked), but static variables are local to the class itself. These variables are shared by all objects of the class and are therefore accessible to non-static methods. Static variable are also accessible to static methods and are therefore accessible even when no objects of the class exist.


How do you create static variables in PHP?

Use the "static" keyword to declare a static variable within a function like shown below. <?php function fun() { static $variable; static $another_variable = ''; } ?>


Can static variables be changed?

No, a static variable means that there is only one copy of that variable, and it is shared by all members of the class, or by all callers of a function.A variable that is read-only would be marked as const or final (depending on language).


Does adding the static keyword to the declaration of these variables in your program change their size?

No. The static keyword only specifies the way a method is declared, used and handled by the JVM and the other classes and does not modify the size it occupies in the memory.


What happens if an abstract modifier is applied to class. Explain?

The classes which have one or more abstract methods are abstract. To declare a class as abstract, use the abstract keyword in front of the class keyword, before the class declaration. Abstract classes cannot be instantiated. Similarly the new keyword cannot be used to create an object of the abstract class. Remember that the constructors and static variables cannot be declared as abstract. Any subclass of an abstract class must either implement all of the abstract methods in the superclass or be itself declared abstract.


Which one executed first static block or static methods in java?

Static Blocks are always executed first. A static block is executed when your class is charged but a static method is executed only when is called, therefor first the class is charged and then is executed a method.