Skip to content

Instantly share code, notes, and snippets.

@ea2305
Created August 7, 2016 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ea2305/b4d769570cbbf92c46f76c79ba2266ed to your computer and use it in GitHub Desktop.
Save ea2305/b4d769570cbbf92c46f76c79ba2266ed to your computer and use it in GitHub Desktop.
public class Test{
static String variable_alcance_global = "Esto funciona !";
public static void main(String []args){
System.out.println( variable_alcance_global );
funcionPrueba();
//System.out.println( alcance_local ); //Esto provocaria un error de
//Compilación porque la variable
//alcance_local no existe.
}
public static void funcionPrueba(){
String alcance_local = " Funciona dentro de la variable "
System.out.println( alcance_local + " de nuevo");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment