Last active
November 15, 2018 08:27
-
-
Save canokay/9b89d12557bf1ebfd7c2cccb79388c62 to your computer and use it in GitHub Desktop.
Java Scanner Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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