CSE 205 - Study Guide - Exam 1
CSE 205 - Study Guide - Exam 1 CSE 205
Popular in Object-Oriented Program & Data
Popular in Computer Science and Engineering
This 16 page Study Guide was uploaded by RianMartins on Saturday September 19, 2015. The Study Guide belongs to CSE 205 at Arizona State University taught by Hsiao in Fall 2015. Since its upload, it has received 600 views. For similar materials see Object-Oriented Program & Data in Computer Science and Engineering at Arizona State University.
Reviews for CSE 205 - Study Guide - Exam 1
I love that I can count on (Rian for top notch notes! Especially around test time...
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/19/15
0mm Now 023 H I mCult mcum mmmeZ CZUmxmgtZuZm r h Km 3 3 37 Magi J 3 u A elk COMPARING NUMBERS STRINGS 1 To compare numbers us a Ex if numl num2 2 To compare strings use equals method a Ex if string1equalsstring2 3 See more below Tquot t quot alxieg itquots 25 ixmam ms m em4 i3 wilu iLgL 5374 M tuu c n ylx 1 4 TYPE CONVERSIONS STRING CONCATENATION amp SPLITS 1 The simplest way to do type conversions is using the Wrapper class 2 Strings can be concatenated only using the operator 3 The split method from the String class see definition above and example below 1 A i I l pbaq immsgorwm A a E TQJW 3 1 47t DOCUMENT THE PROGRAM 1 Comment your program explain what each line of code and methods does 2 Why Because that makes your code more understandable for everybody and even makes your life easier whenever you need to do any kind of changes in it UNDERSTAND IF NESTED IF IFELSE 1 Decision making is a very important part of any program 2 If you are not comfortable with that yet study more chapter 3 sections 31 33 34 UNDERSTAND FOR LOOP WHILE LOOP DOWHILE LOOP 1 All of them can be converted in the other one 2 FOR loop 21 It determines well the number of repetitions that the loop will execute 3 WHILE loop 31 Remember to increment your counter inside the WHILE loop otherwise it will follow in an Infinite loop 4 DOWHILE loop 41 The same as WHILE LOOP the only difference is that it will first execute the code inside the block and then check the condition 42 In other words the DOWHILE loop will always execute the block at least once SINTAXE OF ARRAY ARRAYLIST 7 Arrays awe AwayL045 ArrayLle 00435 VJBIQOAVOH4QSG of Amy5 91106 we fix 39ils 216 we Camoth Choose 14 0mg Conno 5quot0 76 more dockx HMn if size NOW suppose FCC 4031 know how much U06 w Zi be swimm3 U0 Cannot U56 arrays quot Muonquotq663 of AhabLL54 UG Ca 54390396 5amp5 WIT 0536613 66 we won We Cox Or6 okdec 6 Al f CGYGQ In one arraypis olaec f Ar0jLi5quot 09535 I Ming m CAVGJHII PKW a AAA 39 39 m noc UAW cm QEQPC Paamc v VS us39m Vaclav 39 5J en t 0 me 100 we com 4 0 360 0Y6 6 grins OLJGC l on kWhL3 1515 axe 1254 aAA C39sgg h 1 r liLS LAC r 7 2 I I 39 5 r leK CATI GyL z 1 r on M 0394 WG HIOGI COG Can C0655 an Egt gtlt SC Store pn 1H6 awayLs V Inclex39 of anal I bynj axe fist 36 9 mu m abd c issx 51064 0 Ca tqylug hawVG V 9 wl l x pomc meAQTS an MESH am an obdad 50Ppose 39HIG arrayLid 01966quot 713112 Con inns A S Hina pox all chch J a s l mg r b a1 lad1 an a skins r c VaJr molec0 4 we Usc ask me xo wiakq 4713 WekTs an inclgx a SMRS Z STZAcUMd H g 31loth VI UAW be oquot i ext an 51516 019 U i Q modG 4390 AGX 2 0 4 Q m V A1IltCGv 39QL39VGA ynwogz XIZOCA A J V d I v 4 Carrade We waeewa Lbs 5545a quotfRQMOVG 1 quot Remove QQWA 1mm WaL S L m A 5y 0J e r 2VMWGQamp PJ GO THE UNIQUE ROLE OF THE OBJECT CLASS 1 It s also possible make type conversions between objects using the Object class 11 Widening Conversion 12 Narrowing Conversion CAN INTERFACES BE INSTANCIATED WHY OR WHY NOT 1 Interfaces cannot be instantiated An Interface is a contract that a class must respect As such it cannot be instantiated It can be important to define an Interface that a set of classes must respect OVERRIDING INHERITED METHODS 1 First let s see more about inheritance 2 Overriding Methods a X 1 r 1 J 1 k 5 YULC 3 M L hgt C C T415 gt th i J quotquot Ic C iCI WC ht C Gquot39m ta of in In liarloci woehog HCW m Cu 4 V Squot hawquot L16 SC39IYNC 51 ch u39c mgquot h0g3 UVJH i Inng H hoaxJr LCquot Car qu bC dd GVf h quot quoti he HyQH mocjl IQP mot lt63 KLYIQEQGS b S L ml quot kaciowi V64 lab 631 VGTYIAIDS OJJ7 L AC3M L U ll 3 Co05i Jor mC Q SOFTEWARE DEVELOPMENT MODELS amp UML 1 Development models 11 Waterfall model Establish Requirements gt Create Design gt Implement Code gt Test System gt Deploy Obs Once you pass to the next step usually you don t go back One little mistake in the beginning of the development will be dragged until the end 12 Iterative Development Process Establish Requirements gt Create Design gt Implement Code gt Test System gt Deploy Obs The difference between them is that before the deploy phase the development team can go back to the previous step to correct any kind of error Obs The late you see the errors the greater will be the costs to repair it 2 See more in the notes below APPLETS AND GUI COMPONENTS v Making a Java program to generate a GUI is accomplished by using predefined classes in packages such as javaxswing and javaawt v Swing is a comprehensive solution to developing graphical use interfaces 3 There are more than 250 classes v heavy weight container classes v JFrame o The container that holds other Swing userinterface components in Java Graphical applications o It can be used in a Java program with a main method Applications 3 JApplet o It is a subclass of the Applet class 0 Applet is defined in javaapplet package and JApplet is defined in javaxswing package 0 You need to create a class that extends JApplet to create a Swing based Java applet Such class will not contain a main method 0 Instead it contains applet purpose methods such as init start stop and destroy The applet will be displayed with a html file or appletviewer v JDialog o A popup window or message box generally used as a temporary window to receive information from a user or provide notification that an event has occurred 0 A dialog box is a temporary graphical window that pops up These can be displayed alone and are used to contain other components 00 gt Applications using JFrame vs Applets JApplet AJava application is a standalone program with a main method AJava applet is a program that is intended to be transported over the Web and executed using a web browser Similarities Since they both are subclasses of the Container class all the user interface components layout managers and eventhandling features are the same for both classes Differences Applications are invoked by the Java interpreter and applets are invoked by the Web browser Applets have security restrictions Web browser creates graphical environment for applets GUI applications are placed in a frame Security Restrictions on Applets not to damage the system on which the browser is running Applets are not allowed to read from or write to the file system of the computer viewing the applets Note that a new security protocol allows you to use a security policy file to grant applets access to local files Applets are not allowed to run any programs on the browser s computer Applets are not allowed to establish connections between the user s computer and another computer except with the server where the applets are stored INTERFACES AND ABSTRACT CLASSES 339 if EVACAC C NT PQCWQ CwLCi lo fj T TY W39J VACquot 4043 0quot cue ugCA by Q obrame T gt i O39 AC7 0 AOSOL X0 0Q me l C C Q3 6 CL f k J 0N5 impUCWNCA KGA C Xuoe Ou g 5533 m 16 CQQS ch I lgraCC A r 3 i x PUBQC m 7cgc P 22a CQass chCSC EQch imp 960764 H220 i i IOHA 7 AOV CSHI sauce C ruff I JOIA 1AA Ow 6 VOIA lox selQYoSTQ X g i w aw 20H l IOio Ocuso UCe l if sauce 391 lomq o c sC39kQYOS l 2703 3 quotAkinquot
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'