Class 1 y 2 2ciclo

2
Class 1 Delivery notes Class 2 Exposure: Introduction to Java Java.- Java is a language oriented objects EXERCISE 1.- HelloWorld.java (with arguments) Pulic class HelloWorld { Public static void main (String[] args) { System.out.println(“Hello”); }}

Transcript of Class 1 y 2 2ciclo

Page 1: Class 1 y 2 2ciclo

Class 1 Delivery notes

Class 2 Exposure: Introduction to Java

Java.- Java is a language oriented objects

EXERCISE

1.- HelloWorld.java (with arguments) Pulic class HelloWorld

{

Public static void main (String[] args)

{

System.out.println(“Hello”);

}}

Page 2: Class 1 y 2 2ciclo

2.- Seller.java(with income)

import java.util.Scanner; public class Seller { Scanner opt = new Scanner(System.in); String Name; String Surname; String telephone; Vendedor(){ this.Name=""; this.telephone=""; } void signIn (){ System.out.println("Put your name"); Name=opt.nextLine(); System.out.println("Put your Surname"); Surname=opt.nextLine(); System.out.println("Put your telephone"); telephone=opt.nextLine(); } void show() { System.out.println("Name:"+Name); System.out.println("Surname:"+Surname); System.out.println("Telephone:"+telephone); } }