— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet199/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   195   196   197   198   199   200   201   202   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

the ultimate superclass: 
Object
ArrayList
(These are just a few of the 
methods in ArrayList...there 
are many more.)
Even if you take advantage of polymorphism, 
you still have to create a class with methods 
that take and return your polymorphic type. 
Without a common superclass for everything 
in Java, there’d be no way for the developers 
of Java to create classes with methods that 
could take your custom types... types they never 
knew about when they wrote the ArrayList class.
So you were making subclasses of class Object 
from the very beginning and you didn’t even 
know it. Every class you write extends Object, 
without your ever having to say it. But you can 
think of it as though a class you write looks like 
this:
public class Dog 
extends Object
{ }
But wait a minute, Dog already extends something, Canine
That’s OK. The compiler will make 
Canine extend Object 
instead. Except Canine extends Animal. No problem, then the 
compiler will just make Animal extend Object.
Any class that doesn’t 
explicitly extend another 
class, 
implicitly extends 
Object
.
So, since Dog extends Canine, it doesn’t directly extend Object 
(although it does extend it indirectly), and the same is true 
for Canine, but Animal does directly extend Object.
Removes the
object at the
index param
eter. Returns 
‘true’ if the el
ement was in
the list.
Returns ‘true’
if there’s a m
atch for the o
bject parame
ter.
Returns ‘true’
if the list has
no elements
.
Returns eithe
r the index of
the object pa
rameter, or -1
.
Returns the e
lement at thi
s position in t
he list.
Adds the elem
ent to the list
(returns ‘true
’).

Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   195   196   197   198   199   200   201   202   ...   555




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish