Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Clase 1: Introducción del curso y conceptos básicos

Clase 1: Introducción del curso y conceptos básicos

Wilfredo Nieves

February 24, 2017
Tweet

More Decks by Wilfredo Nieves

Other Decks in Education

Transcript

  1. public class MyClass { public static void main(String[] args){ int

    x= 3; x = x * 5; System.out.println(”The value of x = ” + x); //this is a comment } }
  2. public static void main(String[] args){ System.out.println("Bienvenidos al programa de suma

    simple"); System.out.println("Si entras dos números los sumare por ti"); Scanner reader = new Scanner(System.in); System.out.println("Entra un numero: "); int n = reader.nextInt(); System.out.println("Entra otro numero"); int y = reader.nextInt(); int total = n + y; System.out.println("La suma de ambos numero es "+ total); }
  3. public class MyClass { public static void main(String[] args){ //for

    loop for (int i = 0; i<10; i++){ System.out.println(i+""); } //while loop int i = 0; while(i< 12){ System.out.println(i+""); i++; } } }
  4. public class MyClass { public static void main(String[] args){ int

    x = 8; if(x > 10){ System.out.println("x is greater than 10"); }else{ System.out.println("x is less than 10"); } } }
  5. public class MyClass { public static void main(String[] args){ int

    x = 13; if(x > 10 && x < 20){ System.out.println("x is between 10 and 20"); } }
  6. Vehicle speed color make moveForward() stop() steer() Car Motorcycle Bicycle

    Drone fly() //codigo especifico //de drones land()
  7. public class Vehicle { private int speed; private String color;

    private String make; public void moveForward(){ System.out.println("Vehicle moving forward"); } public void stop(){ System.out.println("Vehicle is stopping"); } public void steer(){ System.out.println("Vehicle is steering"); } }
  8. public class Car extends Vehicle { int wheelSize = 16;

    public void openTrunk(){ //Opening trunk code } }