Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE2E1. JAVA Programming Revision Lecture.

Similar presentations


Presentation on theme: "EE2E1. JAVA Programming Revision Lecture."— Presentation transcript:

1 EE2E1. JAVA Programming Revision Lecture

2 The exam The EE2E exam comprises both questions about Java programming and questions about (UML) OOD The paper is in 2 sections – answer 2 out out 4 questions (1 from each section) in 1 and ½ hours

3 Revision The following EE2E1 topics have been covered in lectures
Classes Inheritance/interfaces Swing/GUI’s Files/Streams and Exceptions Multi-threading Network Programming

4 Classes Main revision points
The difference between an object and a class Encapsulation – private, public members Class instance variables and methods (member functions) Static and non-static class members How to refer to a static class member (through the class name) and a non-static member (through the object name)

5 Classes (cont) Main revision points (cont)
Constructors – used for initializing objects The this self-reference pointer

6 Inheritance Main revision points
Derived class objects inherit base class attributes and contain their own class specific attributes Abstract classes Created when it is not sensible to provide an implementation of a particular method Objects of an abstract class can’t be instantiated The Object superclass – generic programs

7 Inheritance (cont) Main revision points (cont)
Polymorphism is a key aspect of inheritance A base class object variable (pointer) can refer to a derived class object Derived class methods are called via the base class pointer

8 Interfaces Main revision points
Interfaces avoid the use of multiple inheritance They are similar to abstract classes but contain only methods and not instance variables Instance objects can’t be instantiated Useful for generic programming

9 Swing/GUI’s Main revision points
Swing/AWT are the main graphics/GUI libraries A graphics program comprises graphics containers and components (Frames, Panels, Buttons etc) Its pretty easy to display graphics and text in graphics containers A graphics program runs in a separate thread to the main thread and essentially listens for user/event interactions

10 Files/Streams and Exceptions
Main revision points Java has many classes supporting I/O A stream is simply a sequence of bytes Can attach streams to files Can do I/O on formatted or compressed data by layering appropriate stream objects File I/O makes extensive use of exceptions for handling error conditions

11 Files/Streams and Exceptions (cont)
Exceptions are the preferred method of error handling Object oriented approach Exception objects contain information about the error The try{} catch{} mechanism is used Exceptions can be handled locally or thrown on

12 Multi-threading Main revision points
A Java program can execute in separate threads Java threads can share data Threads can be initiated by overriding the run() method of the Thread class Threads can run with a priority which can be set Threads are time-sliced and threads are pre-empted by threads of equal or higher priority Synchronised methods – resolves data conflicts when multiple threads access shared objects

13 Network Programming Main revision points Client/Server architecture
A server listens for a client to connect Java has a Socket class which is an abstraction of a network end point Reading/writing a socket is the same as reading/writing to a stream attached to a file A web server provides html for a client’s web browser For multiple clients, a multi-threaded server is required Java has a URL class enabling easy network connection via a url

14 Other issues I have not yet received the 2nd programming reports
However, I will try and get them marked before the exam on 14th May Grades will be displayed on the EE2E1 web site before you sit the exam I will also combine the 2 programming report marks so you know your overall EE2E1 coursework grade (comprising 25% of the EE2E module) before you sit the exam (hopefully!)

15 FAQ’s Will I have to write any code? Yes but not too much
Will syntax errors be penalised? No! Is all the syllabus examinable? No. Only half but I’m not going to tell you which half!

16 Thank you all very much! Good luck in the exam!!


Download ppt "EE2E1. JAVA Programming Revision Lecture."

Similar presentations


Ads by Google