Question: Which statement is TRUE for the following code? public class A { private void display ( ) { System.out.println ( GeeksforGeeks ) ;

Which statement is TRUE for the following code?
public class A
{
private void display()
{
System.out.println("GeeksforGeeks");
}
}
class B
{
public static void main(String args[])
{
A obj = new A();
obj.display();
}
}
Question 3 options:
An object of Class A cannot be created using new A().
The source code is in the file, "B.java".
The display method of Class A cannot be called using the object, obj.
It will be running without any errors.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!