java 三角形面积编程

问题遇到的现象和发生背景
应用面向对象的编程思想,编写计算三角形面积的程序。

问题相关代码,请勿粘贴截图
import java.util.Scanner;;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
triAngle t = new triAngle(in.nextDouble(), in.nextDouble(), in.nextDouble());

System.out.println("[]"+"能构成三角形,面积:"+t.getArea());

}
}

class triAngle {
private double a;
private double b;
private double c;

triAngle(double a, double b, double c){
double max;
if(a > b && a > c) {
max = a;
}else if(b > c) {
max = b;
}else {
max = c;
}

if(a > 0 && b > 0 && c > 0 && a + b > c && a + c > b && b + c > a) {
    this.a = a;
    this.b = b;
    this.c = c;
}else if(max > 0) {
    this.a = max;
    this.b = max;
    this.c = max;
}else {
    this.a = 0;
    this.b = 0;
    this.c = 0;
}

}

double getArea() {
//S=根号[s(s-a)(s-b)(s-c)]
double s = (a + b + c) / 2;
return Math.sqrt(s * (s - a) * (s - b) * (s - c));
}
}

运行结果
输入用例
3
4
5
输出用例
[3.0,4.0,5.0]能构成三角形,面积:6.0
朋友们,我怎么样才能将我从键盘输入的数据在System.out.println("[]"+"能构成三角形,面积:"+t.getArea());这个中括号里面输出来呀

把三角形的三条边用三个double型变量读入,然后传入打印语句中输出,修改如下:

import java.util.Scanner;
public class Test{
    
    
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    double a = in.nextDouble();
    double b = in.nextDouble();
    double c = in.nextDouble();
    triAngle t = new triAngle(a,b,c);

    System.out.println("["+a+","+b+","+c+"]"+"能构成三角形,面积:"+t.getArea());
    }
    }

    class triAngle {
    private double a;
    private double b;
    private double c;

    triAngle(double a, double b, double c){
    double max;
    if(a > b && a > c) {
    max = a;
    }else if(b > c) {
    max = b;
    }else {
    max = c;
    }

    if(a > 0 && b > 0 && c > 0 && a + b > c && a + c > b && b + c > a) {
        this.a = a;
        this.b = b;
        this.c = c;
    }else if(max > 0) {
        this.a = max;
        this.b = max;
        this.c = max;
    }else {
        this.a = 0;
        this.b = 0;
        this.c = 0;
    }
    }

    double getArea() {
    //S=根号[s(s-a)(s-b)(s-c)]
    double s = (a + b + c) / 2;
    return Math.sqrt(s * (s - a) * (s - b) * (s - c));
    }
}