Record Class SealedClassesPreviewExamples.Circle
java.lang.Object
java.lang.Record
net.jrodolfo.java_evolution.java15.SealedClassesPreviewExamples.Circle
- Record Components:
radius- the circle radius
- All Implemented Interfaces:
SealedClassesPreviewExamples.Shape
- Enclosing class:
SealedClassesPreviewExamples
public static record SealedClassesPreviewExamples.Circle(double radius)
extends Record
implements SealedClassesPreviewExamples.Shape
Circle implementation permitted by
SealedClassesPreviewExamples.Shape.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleradius()Returns the value of theradiusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Circle
public Circle(double radius) Creates an instance of aCirclerecord class.- Parameters:
radius- the value for theradiusrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
radius
-