Como puedo llamar a una funcion? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Como puedo llamar a una funcion?

Necesito llamar a una función y meterlo adentro de un case, pero no se como hacer, de la manera que lo intento me marca error, ¿Alguna idea?

27th Apr 2018, 2:19 PM
Abraham Querido
Abraham Querido - avatar
1 Respuesta
0
import java.io.BufferedReader; import java.io.InputStreamReader; import javax.swing.JOptionPane; import java.io.IOException; import java.io.InputStreamReader; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Kerido */ public class Proyecto { public static void comparar(String p1, String p2) { char[] a,a2; int i, ii,c=0; if(p1.length()==p2.length()){ //convierto a minuscula je p1.toLowerCase(); p2.toLowerCase(); a= p1.toCharArray(); a2=p2.toCharArray(); for( i=0;i<a.length;i++){ for(ii=0;ii<a2.length;ii++){ if(a2[ii]==a[i]){ c++; } }} if(c==p1.length()){ System.out.print("Las palabras son anagramas"); }else{ System.out.print("Las palabras no son anagramas"); } }else{System.out.print("Las palabras no son anagramas");} } public static void k(String[]args)throws IOException { InputStreamReader isr = new InputStreamReader (System.in); BufferedReader br = new BufferedReader (isr); int dia,mes,año,año1,semana,x,añobici,y,z,total,u,j; System.out.print("Dame El Dia: "); dia=Integer.parseInt(br.readLine()); System.out.print("Dame El Mes (En Numero): "); mes=Integer.parseInt(br.readLine()); System.out.print("Dame El Año: "); año=Integer.parseInt(br.readLine());
27th Apr 2018, 2:19 PM
Abraham Querido
Abraham Querido - avatar