- 1
What function has got object?
3 ответов
0
main function
0
Can u be more clear ?
0
All non static functions(methods) of an class can be accessed only using objects. so we can say non static function(methods) have objects.
ex: public class abc {
int x=15;
public void display()
{
System.out.println("hello");
}
}
public class mainclass
{
public static void main (string[] args)
{
abc a1= new abc();
System.out.println(a1.x);
System.out.println(a1.display());
}
}
output: 15
hello