Can somebody suggest what is the best way to conve...
# getting-started
a
Can somebody suggest what is the best way to convert following class to Kotlin. It is currently using from different .java classes across the app (which will not become kotlin any time soon). Should I just convert it to
object Geometry
, to
internal object
, or define as companion class? So many ways to choose from 🙂
Copy code
public class Geometry {
    private Geometry() {}

    public static boolean segmentsIntersect(long start1, long end1, long start2, long end2) {
        return end1 > start2 && end2 > start1;
    }

    public static boolean pointWithinSegment(long point, long boundStart, long boundEnd) {
        return boundStart <= point && point < boundEnd;
    }
}