What is the meaning of java void keyword?

JavaWord

1 answer

Answer

1081538

2026-07-20 07:36

+ Follow

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;

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.