Can anybody tell me why I keep getting this error?
Asig02_Attempt2.java:37: <identifier> expected
public void sincronizarCanal(canal)
Am I mixing a class with a method? This is just a small program that simulates a TV. I'm trying to pass a number (chanel) to a method that tells the user that they are now watching chanel (whatever number I passed)...
import java.util.Scanner;
class Televisor
{
int canales,
volumen,
canal,
vol;
public Televisor()
{
canales = 5;
volumen = 10;
}
public void encender()
{
System.out.println("Televisor Encendido.");
}
public void apagar()
{
System.out.println("Televisor Apagado. Adios...");
}
public void sincronizarCanal(canal)
{
System.out.println("El canal ha sido sincronizado al canal" + canal);
}
public void ajustarVolumen()
{
System.out.println("El volumen ha sido ajustado.");
}
}
public class Asig02_Attempt2
{
public static void main(String arguments[])
{
Scanner input = new Scanner( System.in );
Televisor myTVSet = new Televisor();
myTVSet.encender();
System.out.print("Sincronizar al canal --> ");
myTVSet.canales = input.nextInt();
myTVSet.sincronizarCanal(myTVSet.canales);
System.out.print("\n");
System.out.print("Ajustar el volumen a --> ");
myTVSet.volumen = input.nextInt();
myTVSet.ajustarVolumen();
myTVSet.apagar();
}
}