013-002-001
Instance Fields: Circle Class
Easy
Problem Description
Instance Fields: Circle Class
Learning Objective: Understand instance fields concept and that each object has its own values
Create a Circle class and confirm each object has its own radius. Instance fields are unique to each object.
Input
Line 1: Radius of first circle (integer)
Line 2: Radius of second circle (integer)
Output
Circle 1: radius [radius1]
Circle 2: radius [radius2]
Test Cases
※ Output examples follow programming industry standards
Input:
5 10
Expected Output:
Circle 1: radius 5 Circle 2: radius 10
Input:
7 7
Expected Output:
Circle 1: radius 7 Circle 2: radius 7
Input:
0 100
Expected Output:
Circle 1: radius 0 Circle 2: radius 100
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 9 free executions remaining
