Ders Notlarım

Ders 40 - Polymorphism
Polymorphismin amacı bir nesnenin farklı formlarda olması yeteneğidir.Tabi ki bu cümlede bir şey anlamadınız.Örnek ile kısaca açıklayalım.
public class Animal{
public boolean isAlive(){
return true;
}
}
interface CanRun{
...
Read more →

Ders 39 - Interfaces
Bir interface bir abstract veri türüdür ve bu interface abstract public methodların bir listesini tanımlar , ki , bunu implement eden sınıf bu methodları override etmek zorundadır.Bir sınıf "implements" keywordü ile bir interfaceyi implement eder....
Read more →

Ders 38 - Abstract Sınıflar
Arkadaşlar merhabalar , bugün artık yeni konu olan abstract classlara girecez.
Abstract class abstract keywordü ile işaretlemiş ve instantiated olamayacak sınıflardır.Yani siz bu sınıfın nesnesini oluşturamazsınız,başlatamazsınız.Abstract metho...
Read more →

Ders 37 - Kalıtım/Inheritance 4
1)Overriding a method
Bir methodu ezme.Bu olay nasıl oluyor ? Öncelikle bu olayın olabilmesi için parent classımızın içerisinde bir method olması gerek ve eğer ki biz bu methodu child classımızda da kullanırsak bu methodu ezmiş oluruz.Hemen şöy...
Read more →

Ders 36 - Kalıtım/Inheritance 3
Inheritanceye devam ediyoruz.
4-Inheritancede Class üyelerine erişme(method ve variables) :
Javada child classlar parent classın public yada protected erişim belirteçlerine sahip olan methodlar , primitive türlere erişebilir.Tek bir örnekle ...
Read more →

Ders 35 - Kalıtım/Inheritance 2
Arkadaşlar merhabalar Inheritance konusuna devam ediyoruz.
2-Inheritance ile Constructor Tanımlama: Inheritance de arkadaşlar eğer ki super classımız parametre değerine sahip bir constructora sahip ise subclassların hepsi super() komutunu kulla...
Read more →

Ders 33 - Constructor(Yapıcılar)
Arkadaşlar merhabalar bu konuda Constructorlara değineceğiz.Constructor kısaca nedir ?
Öncelikle constructor da bir methoddur fakat bu özel bir methoddur ve bu methodun ismi class ismi ile eşleşmelidir.Constructorlar bir yeni nesne creating edi...
Read more →

Chapter 2 - Soru 50
50. What is the output of the following?
package beach;
public class Sand {
public Sand() {
System.out.print("a");
}
public void Sand() {
...
Read more →

Chapter 2 - Soru 49
49. Which converts a primitive to a wrapper class object without using autoboxing?
A. Call the asObject() method
B. Call the constructor of the wrapper class
C. Call the convertToObject() method
D. Call the toObject() method
Şıklardan hangi...
Read more →

Chapter 2 - Soru 48
48. Which of the following is not a possible output of this code, assuming it runs to
completion?
package store;
public class Toy {
public void play() {
System.out.print("play-");
}
public void finalize() {
&...
Read more →

Chapter 2 - Soru 47
47. Which is a valid constructor for this class?
public class TennisBall {
}
A. public TennisBall static create() { return new TennisBall(); }
B. public TennisBall static newInstance() { return new TennisBall():}
C. public TennisBall() {}
D....
Read more →

Chapter 2 - Soru 46
46. How many objects are eligible for garbage collection right before the end of the main
method?
1:public class Person {
2:public Person youngestChild;
3:public static void main(String... args) {
4:
5:Person elena = new Person();
6:Per...
Read more →

Chapter 2 - Soru 45
45. Fill in the blanks to indicate whether a primitive or wrapper class can be assigned
without the compiler using the autoboxing feature.
_______first = Integer.parseInt("5");
_______second = Integer.valueOf("5");
A. int , int
B. int , Integ...
Read more →

Chapter 2 - Soru 44
44. Which is the most common way to fill in the blank to implement this method?
public class Penguin {
private double beakLength;
public static void setBeakLength(Penguin p, int b) {
&nbs...
Read more →

Chapter 2 - Soru 43
43. Which of the following is the output of this code, assuming it runs to completion?
package store;
public class Toy {
public void play() {
System.out.print("play-");
}
public vo...
Read more →