Created
September 5, 2020 11:13
-
-
Save mrnirva/6ecf4c5503740124cbc3467a400b5384 to your computer and use it in GitHub Desktop.
This file contains 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
package scannerdersi; | |
import java.util.Scanner; | |
public class ScannerDersi { | |
public static void main(String[] args) { | |
// Scanner nesnesini oluşturmak | |
Scanner sc = new Scanner(System.in); | |
//******************************************* | |
// Metin Girdisi Almak | |
System.out.println("Metin Gir: "); | |
String stringMetin = sc.nextLine(); | |
System.out.println("Kelime Gir: "); | |
String stringKelime = sc.next(); | |
//******************************************* | |
// Tam Sayı Girdisi Almak | |
System.out.println("Tam Sayı Gir: "); | |
byte byteSayi = sc.nextByte(); | |
short shortSayi = sc.nextShort(); | |
int intSayi = sc.nextInt(); | |
long longSayi = sc.nextLong(); | |
//******************************************* | |
// Ondalıklı Sayı Girdisi Almak | |
System.out.println("Ondalıklı Sayı Gir (Virgül Kullanın): "); | |
float floatSayi = sc.nextFloat(); | |
double doubleSayi = sc.nextDouble(); | |
//******************************************* | |
// Verileri yazdırmak | |
System.out.println("Girilen Metin " +stringMetin); | |
System.out.println("Girilen Kelime " +stringKelime); | |
System.out.println("Girilen Tam Sayılar: " +byteSayi+" | "+shortSayi+" | "+intSayi+" | "+longSayi); | |
System.out.println("Girilen Ondalıklı Sayılar: " +floatSayi+" | "+doubleSayi); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment