Usando Objetos - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Usando Objetos

Description:

'Hola' s2 'Hola' String s3 = new String ... 'HOLA!!' s2 'HOLA' s5 '!HOLA?' I/0. System.out (pantalla) PrintStream ... System.out.println('Hola'); readLine ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 10
Provided by: homeGa
Category:
Tags: hola | objetos | usando

less

Transcript and Presenter's Notes

Title: Usando Objetos


1
Usando Objetos
Ing. Andrea Quan
2
Clase String
  • Paso 1 Declaramos una variable
  • String s1
  • Paso 2 Construimos un string vacio
  • s1 new String()
  • String s2 new String()

3
  • String s1
  • s1 new String()
  • String s2 new String()

4
  • s1 Hola

s2 s1
5
  • s2 new String(s1)

String s3 new String(Hola)
6
  • s2 s1.toUpperCase()
  • String s4 new s2.concat(!!)
  • String s5 ! s2 ?

7
I/0
  • System.out (pantalla) PrintStream
  • System.in (teclado) InputStream
  • System.out.println(Hola)

8
readLine()
  • Para leer del teclado utilizamos readLine() que
    pertenece a la clase BufferedReader.

System.in
9
  • import java.io.
  • public class Lectura
  • public static void main(String args) throws
    Exception
  • BufferedReader teclado new
  • BufferedReader(new InputStreamReader(System.i
    n))
  • String linea teclado.readLine()
  • System.out.println(linea)
Write a Comment
User Comments (0)
About PowerShow.com