Skip to content

Instantly share code, notes, and snippets.

@canokay
Last active November 15, 2018 08:27
Show Gist options
  • Save canokay/9b89d12557bf1ebfd7c2cccb79388c62 to your computer and use it in GitHub Desktop.
Save canokay/9b89d12557bf1ebfd7c2cccb79388c62 to your computer and use it in GitHub Desktop.
Java Scanner Example
import java.util.Scanner;
public class ScannerExample_1 {
public static void main(String args []){
Scanner input= new Scanner(System.in);
System.out.print("Lütfen mesaj giriniz: ");
String mesaj = input.nextLine();
System.out.println("Girilen mesaj: " + mesaj);
}
}
import java.util.Scanner;
public class ScannerExample_2 {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("İlk Sayı: ");
int sayi1=input.nextInt();
System.out.println("İkinci Sayı: ");
int sayi2=input.nextInt();
System.out.println("Toplam= " +(sayi1+sayi2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment