- 1
Void ()
what I write now here
2 ответов
+ 5
void beSpecific()
{
System.out.println("you need to be more specific");
}
0
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.