Notes
Notes - notes.io |
public class Ogrenci
{
private String hede = "";
// Global Alanda Static Olmayan Değişkenler
public String ad, soyad;
public int okulNo;
public int yas;
// Yukaridaki Değişkenker, Oluşturulan Her Bir Instance
// Icin, Ayri Ayri Oluşturulur,
// Fakat Static Olarak Tanımlanan Okul Adi;
// Kaç Instance Oluşturulursa Oluşturulsun, Bellekte
// Tek Bir Yerde Saklanır Ve Butun Instancelar
// Tarafından Ortak Olarak Kullanılır
public static String okulAdi;
// Bir Ogrenci Instance'i Olusturmak Icin,
// Ogrenci Sınıfının Constructor Methodunu Çağırırız
public Ogrenci()
{
System.out.println("Null Constructor Çağrıldı");
}
public Ogrenci(String oAd, String oSoyad, int oOkulNo)
{
ad = oAd;
soyad = oSoyad;
okulNo = oOkulNo;
yas = 16;
}
public void bilgiGoster()
{
System.out.println("Öğrencinin Adı : "+ad+" "+soyad);
System.out.println("Öğrencinin Okul No : "+okulNo);
System.out.println("Öğrencinin Okulu : "+okulAdi);
}
public int getOkulNo()
{
return okulNo;
}
}
import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
// Instance
Scanner oku = new Scanner(System.in);
// Object Constructor
Ogrenci o1 = new Ogrenci();
Ogrenci o2 = new Ogrenci();
o1.ad = "Emir";
o1.soyad = "Civaş";
o1.okulNo = 1471;
o1.okulAdi = "FMV";
o2.ad = "Sercan";
o2.soyad = "Tuncay";
o2.okulNo = 349;
System.out.println(o2.okulAdi);
Ogrenci o3 = new Ogrenci("Sinan", "Erbaş", 2234);
System.out.println(o3.ad+" "+o3.soyad+" - "+o3.okulNo);
o1.bilgiGoster();
o2.bilgiGoster();
o3.bilgiGoster();
Ogrenci o4 = new Ogrenci();
Ogrenci o5 = new Ogrenci("Ezgi", "Tüfekçi", 3421);
System.out.println(o4.yas+"n"+o5.yas);
}
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team