answersLogoWhite

0

How do I use this keyword with void?

User Avatar

Anonymous

14y ago
Updated: 8/18/2019

These two keywords can't really be used together unless you are accessing this object within a void method.

void printObject() {

System.out.println(this.toString());

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How does the use of the 'void' keyword differ in C plus plus vs. C?

It doesn't. Void has the same meaning in both.


Application of void data type in c plus plus programming language?

The voiddata type is used when a function doesn't return any value, and/or when it has no parameters at all. Pointer type 'void *' is a generic pointer.A void pointer is used when it needs to be assigned to different data types later on in a program. Since it avoids type checking, void pointers should be used with care.


Which keyword is placed within the parenthesis of prototype and definitions if the function does not use arguments?

you can leave it blank or u can use void


The keyword indicates that a method does not return a value?

void


What is the purpose of the keyword void in a function declaration?

when we declare any function with void,it doesnt return any value


What is new keyword in c?

enum, void and const are relatively new keywords in Cnew, on the other hand, isn't a keyword in C


How do explicitly invoke overridden superclass method from a subclass?

Use the super keyword. Example: public class Super { public void methodToOverride() { } } public class Sub { @Override public void methodToOverride() { super.methodToOverride(); } }


What is the meaning of java void keyword?

The void keyword is used to show that a method will not return a value. // no return type public void setX(int x) { this.x = x; } // returns an int public int getX() { return x; }


Can I use your keyword in my question?

Yes, you can use the keyword in your question.


What does a void method do?

In Java, this keyword is used to specify that the method has no return value.


Is it okay to use the keyword in this context?

Yes, it is appropriate to use the keyword in this context.


What's The difference between VOID and void?

In programming, "void" is a keyword used to indicate that a function does not return any value. "VOID" is a term generally used to describe something empty, null, or without substance.