Void () | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Void ()

what I write now here

7th Jun 2017, 6:00 AM
MD. Rehan Mahmud
MD. Rehan Mahmud - avatar
2 Answers
+ 5
void beSpecific() { System.out.println("you need to be more specific"); }
7th Jun 2017, 6:29 AM
Mark Lesniak
Mark Lesniak - avatar
hi, void is a class in java but u can't initialize the class like void v=new void()//wrong. It represents the return type of function or methods which will return nothing to the calling function class sample { void display(int a,int b) { c=a+b; System.out.println("sum"+c); } public static void main(String ar[]) { sample s=new sample(); s.display(10,20); } } which will display sum of two numbers and it return nothing to the calling function.
7th Jun 2017, 6:51 AM
Nanda Balakrishnan