πŸ“Š JAVA
Q. What will be the output of the following Java program?
interface calculate
{
void cal(int item);
}
class display implements calculate
{
int x;
public void cal(int item)
{
x = item * item;
}
}
class interfaces
{
public static void main(String args[])
{
display arr = new display;
arr.x = 0;
arr.cal(2);
System.out.print(arr.x);
}
}
  • (A) 0
  • (B) 2
  • (C) 4
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) 4

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
78
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Kiran Rapria
Publisher
πŸ“ˆ
88%
Success Rate