Alex H. answered 10/16/26
Comfortable, personable, low stress tutoring for newer developers
Great question! In languages like C, C++, C#, and Java, you create sets of instructions that can repeat, and you store them in "buckets" called methods. Think of them being like a recipe of how to do something. Depending on the type of instructions, you might want to have the instruction give you back a type of result, like a string, or a boolean value. These return a value type. But, in some cases, you just want the instructions to be followed, without question. You're not interested in returning anything from the method. This is what the void keyword does for you. Void methods don't return an object or a type - they just execute the instructions contained in the method.