Last active
December 30, 2015 02:59
-
-
Save raziyeaydin/7766416 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 kitap.bolum10.nyp; | |
import java.util.Scanner ; | |
public class Insan { // Insan adında bir sınıf oluşturuldu. | |
static double boy ; // | |
static String cinsiyet ; // Sınıfa ait özellikler | |
static int yas ; // | |
static String isim ; // | |
public static void bilgi(){ | |
Scanner tara = new Scanner(System.in); | |
System.out.print("isminizi giriniz: "); | |
isim = tara.nextLine(); | |
System.out.print("boyunuzu giriniz: "); | |
boy = tara.nextDouble(); | |
//Kullanıcı bilgilerinin alınması | |
System.out.print("cinsiyetinizi yazınız: "); | |
cinsiyet = tara.next(); | |
System.out.print("yaşınızı yazınız: "); | |
yas = tara.nextInt(); | |
} | |
public static void main(String[] args) { | |
Insan kisi = new Insan(); //Insan sınıfına ait kisi adlı nesnenin oluşturulması | |
bilgi(); //oluşturulan metodun kullanılması | |
System.out.print(kisi.isim+","+kisi.yas+" yaşında "+kisi.boy+" boyunda "+"cinsiyeti ise "+kisi.cinsiyet); //bilgilerin ekrana yazdırılması... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment