answersLogoWhite

0


Best Answer

No. When a method is declared static, it is defined outside of any individual class reference.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can this pointer be used within the concept of the static method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the implicit name of the parameter that gets passed into the set method of class in c?

Every non-static member function has a hidden pointer parameter named this which refers to the instance of the class the function was invoked against. For a given class, C, the type of the hidden this pointer is const C* but if the function is declared const, the pointer is const C* const. When referring to any class member, m, from within any non-static member function, this->m is implied.


Do methods reside within an object?

ya methods resides within an object.. because if we declare a method static it can be called by object genration.. and static variables reside in heap known as permanent genration...


What is the purpose of the this operator?

The 'this' pointer is not an operator, it is a special pointer that exists within every instance of a class, and always points to the current instance of that class. It can only be used in non-static methods of the class because static methods do not have a 'this' pointer; static methods can be called even when there is no instance of the class. Whenever an instance method refers to one of its own members (non-static members), the 'this' pointer is implied: int CMyObject::foo() { return( this->bar ); // returns the bar member of this instance. } The 'this' pointer also makes it possible for an instance to compare itself to other instance references (often to ensure they are different instances) as well as to return a reference to itself. The assignment operator cannot be implemented any other way: CMyObject& CMyObject::operator= (const CMyObject & rhs ) { if( this != &rhs ) // check for self-reference bar = rhs.bar; // perform assignment return( *this ); // return a reference to this instance. } The 'this' pointer also allows an instance to pass a reference or pointer to itself to external functions, including the methods of other instances of the same class.


What is seekg?

In C++, seekg is a method/function of the standard fstream library (fstream::seekg()) which allows you to position the 'get' pointer to an arbitrary position within the stream.


Is it possible to define a java static method inside a main method?

Because, the main method is the starting point of the java program and if we need an object of that class even before the main can be invoked, it is not possible. Hence it is declared static so that the JVM Can acess the main method without having to instantiate that particular class


What is an anchor pointer within a marquee?

File


In bluej can there be a method within a method?

No, Java only allows a method to be defined within a class, not within another method.


Static keyword in java?

A Static method in Java is one that belongs to a class rather than an object of a class. Normal methods of a class can be invoked only by using an object of the class but a Static method can be invoked Directly. Example: public class A { ..... public static int getAge(){ .... } } public class B { ..... int age = A.getAge(); } In class B when we wanted the age value we directly called the method using the instance of the class instead of instantiating an object of the class. Tip: A static method can access only static variables. The reason is obvious. Something that is common to a class cannot refer to things that are specific to an object...


Why inline function cannot be static?

Inline functions can be static. However, their usage outside of classes in C++ has been deprecated (a hangover from C). Static member functions are allowed of course, and they can be inline expanded where desired. In C, a static function simply has limited scope within the same translation unit. In C++, unnamed namespaces are the preferred method of achieving the same end.


What do you mean by static modifier in java?

The static keyword associated with a method or a variable in java specifies that the entity belongs to the class and not any object instance of the same.Static MethodsStatic keyword when used with a method, specifies that this method belongs to the class and not a particular instance of the class (a.k.a object of the class)Ex:public class StaticTest {public static String getAuthorName() {return "Anand";}}Here getAuthorName is the static method and it can be accessed without instantiating an object of the class StaticTest. You can access this method as:String authorName = StaticTest.getAuthorName();Static VariablesThe static modifier tells the system that this particular variable belongs to the class and does not belong to any specific instance of the same. The class will contain only one instance of the static variable irrespective of how many objects of the class you create.


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 = ''; } ?>


Do a mouse pointer display as a hand with a pointing finger within a worksheet?

Within Excel the mouse pointer can have a lot of different shapes including the hand with the pointing finger. It depends on what is being done.