Aprender Java

Aprender Java

Preguntas y Problemas

¿Cómo leer un archivo en Java?

Podemos leer un archivo usando la clase Scanner de la siguiente manera:

//crear
Scanner in;
try{
in = new Scanner(new File("archivo.txt"));
}catch (FileNotFoundException e1){
//codigo...
}
//Leer datos
try{
String s=in.nextLine();
}catch (NoSuchElementException e2){
}catch (IllegalStateException e3){
}

¿Cómo pedir un String con JOptionPane?

Un ejemplo sencillo es el siguiente:

import javax.swing.JOptionPane;
public class Main {
public static void main(String args[]) {
String nombre
= JOptionPane.showInputDialog("Ingrese su nombre:");
JOptionPane.showMessageDialog(null, "Hola " + nombre, "Bienvenido",
JOptionPane.PLAIN_MESSAGE);
// el primer algumento ( null ) indica la posicion , null indica
// el centro de la pantalla
}
}


Links:
  1. Pandas en Python, con ejemplos -Parte I- Introducción - https://jarroba.com/pandas-python-ejemplos-parte-i-introduccion/
  2. Loading A CSV Into Pandas - https://chrisalbon.com/python/pandas_dataframe_importing_csv.html
  3. Python Pandas - DataFrame - https://www.tutorialspoint.com/python_pandas/python_pandas_dataframe.htm
  4. https://es.wikipedia.org/wiki/NumPy
  5. https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.where.html
  6. https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.concatenate.html
  7. http://docs.python.org.ar/tutorial/3/classes.html
  8. http://docs.python.org.ar/tutorial/2/classes.html
  9. http://www.cristalab.com/tutoriales/crear-matrices-en-python-utilizando-listas-c103122l/
  10. http://fitoria.net/2011/11/django-suite-iii-usand-virtualenv-y-pip.html
  11. https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do
  12. http://docs.python.org.ar/tutorial/3/datastructures.html

No hay comentarios.:

Publicar un comentario