COMPSCI 61B Study Guide - Midterm Guide: Sooke, Linked List, Junit
CSGIB Into Notes
AJR 1.1-1.9
private :restricts aaesstoomythe current class
conditional expression :Syso( 3<4 ?"Less ":"MoreDj
strings intitntegakparsetnt
whileaondition statement
do .while :test after each iteration
do{
body
}while( condition ;
Primitive Types
.boolean JVM .specific twelfalse
°char
lbbitsbbytec
-765535
.byte 8bits/lbyte -2 '→2 '
-i
.short lbbittabytes -2152 's
.i
oint
3214
-23423 't
.long
64/8 -262,263.1
.float
32/4 -3.408-73.4038
.double
6418 -1.7008-1.78308
CSGIB INWNOHSZ
Station .Nonstatic :
.static methods
Nonslaticmethodsttnstancemethods
.invokedwithdassname .invoked
with instance name
.can't access instance Variables °method isspeafictoobjeetitscalled with
→ no "Me "
iwhendoweuse ?
certain cases like Math .Doesn't make sensetomakeaspeuficinstaceofmath
.instead x=MathDVndC 5.6 )
think like :static :program running ,versus nonstaticwhere "I" amwnningwith
MY instance
Static variables :instance variable for all dogs .something allobjeotshavethesameot
o(aaesswithdass ...( ahdowlthobjehtbutdoesntmakesenseto ).
smwadtg
'hI§ in
0,1 ,2
hvlgedos bark
weight .-150 Woof
2WOOF
neWD08
weishtlk
Document Summary
Ajr 1. 1-1. 9 private : conditional restricts aaesstoomythe expression :syso( 3<4 ? current class. :test after each iteration do . do{ body. Nonslaticmethodsttnstancemethods invoked invokedwithdassname with instance name can"t access instance. Doesn"t make sensetomakeaspeuficinstaceofmath instead x=mathdvndc 5. 6 ) think like static : program running , versus nonstaticwhere. Static variables : instance variable for all dogs . something allobjeotshavethesameot aaesswithdass ahdowlthobjehtbutdoesntmakesenseto in. 2 newd08 weishtlk compiler java javac class. Dog d dogs = new dog [ dj static vs. Instance static methods invoked with class instance methods invoked with instance name ( can"t with name ( or object snakes lessens name e) class ) static methods. Must access with variables since they instance instance specific. : byte , short int long , float. : copy "s bits works for parameters: 8 primitive types, groe ( golden array int. []a= new int d { 0,1 , 2,95 , 43 ; linked list tadt dad.