¿errores en java "class, interface or enum expected"?

se supone q así como tengo el programa debería ser compilado:

import javax.swing.JOptionPane;

public class Triang{

double a;

double b;

double c;

public void setValores(double va, double vb){

a = va;

b = vb;

}

public void calcule_c(){

c = Math.pow(Math.pow(a,2)+Math.pow(b,2), 0.5);

}

public double getC(){

return c;

}

public void leaDatos(){

a = Integer.parselnt (JOptionPane.showInputDialog("Valor de a = "));

b = Integer.parselnt (JOptionPane.showInputDialog("Valor de b = "));

}

}

public static void main (String a[]){

Triang t=new Triang();

t.leaDatos();

t.calcule_c();

System.out.println("c = "+t.getC());

}

}

pero me salen estos errores:

5 errors found:

File: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java [line: 50]

Error: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java:50: class, interface, or enum expected

File: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java [line: 53]

Error: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java:53: class, interface, or enum expected

File: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java [line: 54]

Error: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java:54: class, interface, or enum expected

File: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java [line: 55]

Error: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java:55: class, interface, or enum expected

File: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java [line: 56]

Error: C:\Documents and Settings\satelite\Configuración local\Temp\Rar$DI00.515\Triang.java:56: class, interface, or enum expecte

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2025 Q2A.ES - All rights reserved.