πŸ“Š JAVA
Q. Choose the correct statement
public class Circle{
private double radius;
public Circle(double radius){
radius = radius;
}
}
  • (A) The program has a compilation error because it does not have a main method.
  • (B) The program will compile, but we cannot create an object of Circle with a specified radius. The object will always have radius 0.
  • (C) The program has a compilation error because we cannot assign radius to radius.
  • (D) The program does not compile because Circle does not have a default constructor.
πŸ’¬ Discuss
βœ… Correct Answer: (B) The program will compile, but we cannot create an object of Circle with a specified radius. The object will always have radius 0.

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
113
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Ravi Shankar
Publisher
πŸ“ˆ
95%
Success Rate