Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a void method

Tags:

java

Currently I have this code coded as a part of a separate Java class.

 public void setSubtotal ()
 {
   subtotal = Validator.getDouble(sc,"Enter subtotal:", 0, 10000);    
 }

And I want to call to it from another method. I already have this class instantiated so I can call to it, but I'm not sure how to call to this method since it's a void method.

like image 854
user2603112 Avatar asked Jul 20 '13 22:07

user2603112


1 Answers

all you gotta do is

 this.setSubtotal();

since you're doing it inside the same class

like image 119
user2277872 Avatar answered Sep 23 '22 02:09

user2277872