Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java: An Operational Semantics GauravGaurav S. Kc Gaurav B. Eng. Project Department of Computing.

Similar presentations


Presentation on theme: "Java: An Operational Semantics GauravGaurav S. Kc Gaurav B. Eng. Project Department of Computing."— Presentation transcript:

1 Java: An Operational Semantics GauravGaurav S. Kc Gaurav B. Eng. Project Department of Computing

2 Semantics of Java -- why? n Semantics: –Assignment of meanings to programs n Java: –A simple, object-oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language.

3 Why? … contd. n Better “mental model” of language n Acceptance –reliability –expected behaviour n Java : Security v.s. functionality n Widespread use n Reasoning: towards a compromise

4 Project Goals n Semantics extension n Better understanding of Java n Research based -- no implementation

5 Break-down into parts n Existing features: –inheritance –instance variables –overloading and overriding n Additions: –access modifiers –final, static, abstract –constructors

6 An example in the new syntax abstract class Animal extends Object { int age; Animal() { super();} int getAge() {...} } public final class Dog extends Animal { final int legs = 4; final static boolean hasTail = yes; Dog() { this(“Laika”); } Dog(String s) { super(); … } int getAge(String name) {…} }

7 Access Modifiers n Public n Protected n Private n [default] n No packages l Accessibility checks Semantics extension...

8 Final and Abstract modifier n Classes –sub-classing not permitted –instantiating not permitted n Fields –Constant behaviour? l Well-formedness l Constructor invocation l Assignment Semantics extension...

9 Static modifier n Fields that don’t belong to objects n Class and interface fields n State extension: –Class/interface entries –References l Runtime checks l Class or interface v.s. object Semantics extension...

10 Constructor A constructor is used in the creation of an object that is an instance of a class. It is the basis with which the run-time system allocates space from memory to objects during execution. n Instance fields & [inherited] instance fields n OutOfMemory exception n Static initialisation

11 Syntax of a Constructor n Explicit constructor invocation –this(); n same class –super(); n parent class n static initialisation n Statements public class C extends B { int x = 5; public C (int n) { this(true); print(n); } private C (boolean b) { super(); if (b) … }

12 [boolean] C(true),  [] B(); x=5; if (b) …,  Constructor execution new C(true);

13 Other research work on Java n Within the Department of Computing: –ExceptionsSLURP@DoC SLURP –ConcurrencySLURP@DoC SLURP –Binary CompatibilitySLURP@DoC SLURP n In other research institutions: –GenericsPLT@Rice PLT –Security IssuesSIP@Princeton SIP

14 Other research, … contd. n A comparison perhaps? –Different aspects of Java –Post-grad & post-doc work

15 Conclusions n Boring? Certainly not! n Acquired skills n Taste of pure research n Lots of non-trivial work n State of the art technology n Continued research in Java Semantics n Improved know-how of the Java system

16 Acknowledgements n Krysia Broda n Sophia Drossopoulou n Susan Eisenbach n Tanya Valkevych


Download ppt "Java: An Operational Semantics GauravGaurav S. Kc Gaurav B. Eng. Project Department of Computing."

Similar presentations


Ads by Google