Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Computer Laboratory – Course material 2009–10: Object-Oriented Programming Skip over navigation | Access key help ||| Computer Laboratory Course material 2009–10   Computer Laboratory > Teaching > Course material 2009–10 > Object-Oriented Programming Additional Topics Advanced Category Theory in Computer Science Advanced Computer Design Advanced Graphics Advanced Systems Topics Advanced Topics in Computer Systems Advanced Topics in Concurrency Advanced Topics in Programming Languages Algorithms I Algorithms II An Algebraic Approach to Internet Routing Artificial Intelligence I Artificial Intelligence II Automated Reasoning Basic Rewriting Theory Bioinformatics Building an Internet Router » Business Studies Categorical Logic Category Theory for Computer Science Chip Multiprocessors Comparative Architectures Compiler Construction Complexity Theory Computation Theory Computer Design Computer Graphics and Image Processing Computer Vision Concepts in Programming Languages Concurrent and Distributed Systems Databases Denotational Semantics Digital Communication I Digital Communication II Digital Electronics Digital Signal Processing Discrete Mathematics I Discrete Mathematics II Distributed Systems E-Commerce ECAD Labs » Economics and Law Floating-Point Computation Foundations of Computer Science Further Java Group Project Group Project Briefing Hardware Practical Classes How to Study Computer Science Human-Computer Interaction Information Retrieval Information Theory and Coding Innovative user interfaces Interactive Formal Verification Introduction to Security Introductory Logic Logic and Proof Low Power Embedded Systems Programming Mathematical Methods for Computer Science Natural Language Processing Network Architecture Object-Oriented Programming Information for supervisors Operating Systems Optimising Compilers Part IB Assessed Exercise Briefing Probability Professional Practice and Ethics Programming in C and C++ Programming in Java Prolog Quantum Computing Registration Regular Languages and Finite Automata Research Methods » Security Semantics of HOT Languages Semantics of Programming Languages Set Theory for Computer Science Software Design Software Engineering Software Verification Specification and Verification I Specification and Verification II System on Chip Design and Modelling System-on-Chip Design Topics in Concurrency Topics in Logic and Complexity Topics in Security: Forensic Signal Analysis Types Unix Tools   Object-Oriented Programming 2009–10 Principal lecturer: Dr Robert Harle Taken by: Part IA CST, Part IA NST, Part I PPS Syllabus Past exam questions Information for supervisors (contact lecturer for access permission) Updates **** Sample tripos questions now available on this page **** Handout/Notes The handout provided in Lecture one is available by clicking here. Annotated PDFs are also available First part (Hardware/OOP). Second part (Java). Third part (Design patterns) Some of you asked for a copy of the slides from the final lecture (which has a summary of the course at the end): they are available here. Errata The original handout is a bit weak on the pass by refernce stuff. Hopefully the extra notes below and what I said in the lectures will mean it doesn't matter to you. However, for clarity: Jave is purely "pass by value": every function argument is copied (=pass by value), BUT only primitives and references can be passed (so actual object don't end up being copied). On slide 68 I have some code that says "if (b==0) throw DivideByZeroException();". This actually won't compile becuse it tries to call a constructor without the new command. What I meant to say was "if (b==0) throw new DivideByZeroException();" The generic diagram for the Abstract Factory is wrong. ConcreteFacory1 should create only ProductA1 and ProductB1, whilst ConcreteFactory2 produces ProductA2 and ProductB2. I have updated the annotated notes above to reflect it (but your handout is wrong: sorry). Extra Notes In lecture 2 I showed some code to illustrate reference handling. I know some people didn't completely get it so I have prepared an addendum to the notes that goes through it. Click here to see it. Sample Exam Questions I have started to produce a few sample exam questions for the course since there isn't much of a history for you to try. You will find them here: Sample Exam Questions. The feedback system provided me with a convenient list of users IDs: if you didn't fill out a feedback form for the course, you will need to email me for access to this page. In addition, some of the old Java course questions are relevant (you'll need to apply common sense to decide whether the question is appropriate. If you're worried, email me and I will tell you whether a question is appropriate). You may also wish to look at the Programming Methods tripos question from last year. I also wrote some sample exam questions for that course, together with solutions. They are mostly (but not completely) applicable to the OOP course: they're certainly good practice. Eclipse Some of you have asked about the programming environment I'm using in lectures. This is a free program called Eclipse and you can download it from here. You can download various add-ons to support different programming languages, but if you download and install the "Eclipse IDE for Java Developers" you should find that has everything you need for Java development. If you're wondering why we don't use it with you in the ticks, it's because we're trying to do two things: i) teach you Java, and ii) make you familiar with UNIX (which is very popular, especially in scientific circles). The eclipse platform is great, but it masks away the UNIX stuff and can be quite bewildering. Once you're proficient in Java, using a tool like Eclipse is highly recommended. But for now, stick to UNIX. If you're looking for a way to do your ticks from home, you can download the Java tools (compiler, virtual machine, etc) here. Alternatively you can login the PWF from your room (see here and here for details. Code Snippets If there's any code from the lectures you'd like to see, please let me know and I'll put it up here. Vector2D The basic code we developed in lectures is here: Vector2D.java Cloning Cloning is a bit of a minefield but you learn a lot from studying it. If you want to look over the basic example from lectures you'll need the following: Address.java CloneExample.java Person.java Singleton The code we developed in lectures is here. Note I have edited it slightly to include comments andto make the constructor protected so you can use it to play with cloning it.   © 2010 Computer Laboratory, University of Cambridge Please send any comments on this page to Dr Robert Harle Last modified 2010-03-29 18:15 by Robert Harle