The Heads and Tails of Project Coin

Size: px
Start display at page:

Download "The Heads and Tails of Project Coin"

Transcription

1 The Heads and Tails of Project Coin Alex Buckley Specification Lead, Java Language & VM 1 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

2 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 2 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

3 Project Coin is a suite of language and library changes to make things programmers do everyday easier. 3 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

4 Outline Overview and Demo Retrospective on developing JDK 7 Coin features Possible small language changes in JDK 8 and later 4 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

5 JDK 7 Survey Downloaded JDK 7? coin-dev subscriber? OpenJDK contributor? 5 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

6 Project Coin benefits Remove extra text to make programs more readable Encourage writing programs that are more reliable Integrate well with past and future changes 6 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

7 Project Coin design constraints Small language changes Specification Implementation Testing Coordinate with larger language changes, both past (generics) and future (Lambda) Manage complex language interactions Specification Implementation 7 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

8 The Six Coin Features and How They Help Consistency and clarity Strings in switch Numeric literal improvements More concise error handling Multi-catch with more precise rethrow try-with-resources Easier to use generics Diamond Safe varargs 8 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

9 Project Coin support in IDEs IntelliJ IDEA 10.5 and later Eclipse and later NetBeans 7.0 and later DEMO 9 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

10 Project Coin features Binary literals and underscores in numeric literals Strings in switch Diamond Multi-catch and more precise rethrow try-with-resources Safe varargs 10 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

11 Safe Varargs Summary: no longer receive uninformative unchecked warnings from calling platform library methods: <T> List<T> Arrays.asList(T... a) <T> boolean Collections.addAll(Collection<? super T> c, T... elements) <E extends Enum<E>> EnumSet<E> EnumSet.of(E first, E... rest) void javax.swing.swingworker.publish(v... chunks) New annotation type SafeVarargs 11 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

12 Profitable to use! Retrofitted Project Coin features in the JDK code base Improve the existing code base by coinification Validate the design of features through use Detectors / converters applied for diamond, try-with-resources Coin features also in new library and test code, including NIO.2 (JSR 203) utility methods 12 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

13 How Coins were Minted Easy for the programmer, more work for the compiler! Internal compiler desugaring strings in switch try-with-resources Coordinated library changes java.lang.{autocloseable, SafeVarargs} Throwable.addSuppressed Serialized form of Throwable, new constructors Systematic application of new library features 13 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

14 // Original sugared switch(s) { case "a": case "b": return 10; } case "c": case "d": return 20;... // s mapped to offset switch($t) { case 1: case 2: return 10; } case 3: case 4: return 20; Copyright 2012, Oracle and/or its affiliates. All rights reserved.

15 // Original sugared switch(s) { case "a": case "b": return 10; } case "c": case "d": return 20;... // // Desugared int $t = -1; switch(s.hashcode()) { case 0x61: // "a".hashcode() if(s.equals("a")) $t = 1; break; case 0x62: if(s.equals("b")) $t = 2; break;... } s mapped to offset switch($t) { case 1: case 2: return 10; } case 3: case 4: return 20; Copyright 2012, Oracle and/or its affiliates. All rights reserved.

16 try-with-resources desugaring try ResourceSpecification Block { final VariableModifiers_minus_final R #resource = Expression; Throwable #primaryexception = null; 16 Copyright 2012, Oracle and/or its affiliates. All rights reserved. } try ResourceSpecification tail Block catch (Throwable #t) { #primaryexception = t; throw #t; } finally { if (#resource!= null) { if (#primaryexception!= null) { try { #resource.close(); } catch(throwable #suppressedexception) { #primaryexception.addsuppressed(#suppressedexception); } } else { #resource.close(); } } }

17 Library support for try-with-resources Not just a language feature! New superinterface java.lang.autocloseable All AutoCloseable and by extension java.io.closeable types usable with try-with-resources Retrofit Closeable/AutoCloseable to Java SE API JDBC 4.1 retrofitted as AutoCloseable too Suppressed exceptions are recorded using a new facility Throwable.addSuppressed Suppressed exception info included in stack trace, etc. 17 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

18 Throwable New field added to store suppressed exception data Serial compatibility must be kept with older releases IIOP serialization matters too! HotSpot specially creates certain exception objects Allow stack traces for OutOfMemoryError Need to document and follow a VM libraries protocol Exception objects should be able to be immutable New constructors added to Throwable Preserve immutability on serialize deserialize cycle 18 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

19 A Systematic Update Ran annotation processors over the JDK Types to be retrofitted as Closeable/AutoCloseable: Project Coin: Bringing it to a Close(able), See Methods and constructors to be annotated Project Coin: Safe Varargs in JDK Libraries, See Can run the same processors over your own code 19 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

20 Retrospective In the beginning A small language change needs to be small in all of: Specification Implementation Testing Not the only relevant dimensions 20 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

21 for (Coin coin : jdk7coins){ } Project Coin specification as a whole Design issues, alternatives, surprises Size of implementation Specification and implementation evolution Bug tail 21 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

22 22 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

23 23 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

24 Cross references in Java SE 7 JLS 24 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

25 Impact of Project Coin 25 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

26 JLS sections changed by Project Coin Improved Numeric Literals Integer Literals Floating-Point Literals Strings in Switch The switch Statement Safe varargs 4.8 Raw Types Variables of Reference Type Formal Parameters SafeVarargs (New!) Evaluate Arguments Diamond 15.9 Class Instance Creation Expressions Determining the Class being Instantiated Choosing the Constructor and its Arguments 18 Syntax 26 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

27 More JLS sections changed by Project Coin Multi-catch / more precise rethrow final Variables Exception Analysis of Statements Exception Checking Superclasses and Superinterfaces The try statement 18 Syntax try-with-resources final Variables 6.3 Scope of a Declaration 6.4 Shadowing and Obscuring Exception Analysis of Statements The try statement try-with-resources (New!) 18 Syntax 27 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

28 1. Improved numeric literals Grammar changes a bit tricky to get right; multiple underscores between digits: Digits: Digit Digit DigitsAndUnderscores opt Digit DigitsAndUnderscores: DigitOrUnderscore DigitsAndUnderscores DigitOrUnderscore 28 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

29 Implication of multiple underscores Do we want this to be allowed? // Courtesy Josh Bloch int bond = ; 29 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

30 What about the octal base? If these are illegal integer literals 0x_abcd 0b_0101 should 0_1234 be legal? (Yes, because the leading 0 is more a digit than a base specifier) 30 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

31 Implementing numeric literals 1 small changeset No post-integration surprises 31 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

32 2. Strings in switch: specification change JLS The switch Statement The type of [the switch] Expression must be char, byte, short, int, Character, Byte, Short, Integer, String, or an enum type ( 8.9), or a compile-time error occurs. 32 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

33 Strings in switch proposal form PROJECT COIN SMALL LANGUAGE CHANGE PROPOSAL FORM v1.0 AUTHOR(S): Joseph D. Darcy OVERVIEW Provide a two sentence or shorter description of these five aspects of the feature: FEATURE SUMMARY: Should be suitable as a summary in a language tutorial. Add the ability to switch on string values analogous to the existing ability to switch on values of the primitive types. MAJOR ADVANTAGE: What makes the proposal a favorable change? More regular coding patterns can be used for operations selected on the basis of a set of constant string values; the meaning of the new construct should be $take_default = false; boolean $fallthrough = false; $default_label: { switch(s.hashcode()) { // cause NPE if s is null case : // "quux".hashcode() if obvious to Java developers. (!s.equals("quux")) { $take_default = true; break $default_label; } processquux(s); $fallthrough = true; case : // "foo".hashcode() if (!$fallthrough && MAJOR BENEFIT: Why is the platform better if the proposal is adopted?!s.equals("foo")) { $take_default = true; break $default_label; } $fallthrough = true; case 97299: // "bar".hashcode() if (!$fallthrough &&!s.equals("bar")) { Potentially better performance for string-based dispatch code. $take_default = true; break $default_label; } processfooorbar(s); break; case 97307: // "baz".hashcode() if (!s.equals("baz")) { $take_default = true; break MAJOR DISADVANTAGE: There is always a cost. $default_label; } processbaz(s); $fallthrough = true; default: $take_default = true; break $default_label; } } if($take_default) processdefault(s); } Some increased implementation and testing complexity for the compiler. In the advanced example, the boolean "fallthrough" variable is needed to track whether a fall-through has occurred so the string equality checks can be ALTERNATIVES: Can the benefits and advantages be had some way without a language change? skipped. If there are no fall-throughs, this variable can be removed. Likewise, if there is no default label in the original code, the $take_default variable is not No; chained if-then-else tests for string equality are potentially expensive and introducing an enum for its switchable constants, one per string value of needed and a simple break can be used instead. interest, would add another type to a program without good cause. In a translation directly to bytecode, the synthetic state variables can be replaced with goto's; expressing this in pseudo Java source with goto: EXAMPLES // Advanced example in pseudo Java with goto switch(s.hashcode()) { // cause NPE if s is null case : // "quux".hashcode() if (!s.equals("quux")) goto Show us the code! $default_label; goto $fooorbarcode_label; case : // "foo".hashcode() if (!s.equals("foo")) goto $default_label; goto $fooorbarcode_label; case SIMPLE EXAMPLE: Show the simplest possible program utilizing the new feature : // "bar".hashcode() if (!s.equals("bar")) goto $default_label; $fooorbarcode_label: processfooorbar(s); break; case 97307: // "baz".hashcode() if String s =... switch(s) { case "foo": processfoo(s); break; } (!s.equals("baz")) goto $default_label; processbaz(s); default: $default_label: processdefault(s); break; } ADVANCED EXAMPLE: Show advanced usage(s) of the feature. Related to compilation, a compiler's existing diagnostics around falling through switches, such as javac's -Xlint:fallthrough option and String s should work identically on switch statements based on Strings. switch(s) { TESTING: How can the feature be tested? case "quux": Generating various simple and complex uses of the new structure and verifying the proper execution paths occur; combinations to test include switch processquux(s); // fall-through statements with and without fall-throughs, with and without collisions in the hash codes, and with and without default labels. case "foo": LIBRARY SUPPORT: Are any supporting libraries needed for the feature? case "bar": No. processfooorbar(s); REFLECTIVE APIS: Do any of the various and sundry reflection APIs need to be updated? This list of reflective APIs includes but is not limited to core break; case "baz": reflection (java.lang.class and java.lang.reflect.\*), javax.lang.model.\*, the doclet API, and JPDA. processbaz(s); // fall-through Only reflective APIs that model statements in the source language might be affected. None of core reflection, javax.lang.model.\*, the doclet API, and JDPA default: processdefault(s); model statements; therefore, they are unaffected. The tree API in javac, does model statements, but the existing API for switch statements is general break; } enough to model the revised language without any API changes. DETAILS OTHER CHANGES: Do any other parts of the platform need be updated too? Possibilities include but are not limited to JNI, serialization, and output of the SPECIFICATION: Describe how the proposal affects the grammar, type system, and meaning of expressions and statements in the Java Programming javadoc tool. Language as well as any other known impacts. No. The lexical grammar is unchanged. String is added to the set of types valid for a switch statement in JLSv3 section Since Strings are already included MIGRATION: Sketch how a code base could be converted, manually or automatically, to use the new feature. in the definition of constant expressions, JLSv3 section 15.28, the SwitchLabel production does not need to be augmented. The existing restrictions in Look for sequences of if ("constant string".equals(foo)) or if (foo.equals("constant string")) and replace accordingly. on no duplicate labels, at most one default, no null labels, etc. all apply to Strings as well. The type system is unchanged. The definite assignment analysis COMPATIBILITY of switch statement, JLSv3 section , is unchanged as well. BREAKING CHANGES: Are any previously valid programs now invalid? If so, list one. COMPILATION: How would the feature be compiled to class files? Show how the simple and advanced examples would be compiled. Compilation can be All existing programs remain valid. expressed as at least one of a desugaring to existing source constructs and a translation down to bytecode. If a new bytecode is used or the semantics of an EXISTING PROGRAMS: How do source and class files of earlier platform versions interact with the feature? Can any new overloadings occur? Can any existing bytecode are changed, describe those changes, including how they impact verification. Also discuss any new class file attributes that are introduced. new overriding occur? Note that there are many downstream tools that consume class files and that they may to be updated to support the proposal! One way to support this change would be to augment the JVM's lookupswitch instruction to operate on String values; however, that approach is not recommended or necessary. It would be possible to translate the switches to equivalent if-then-else code, but that would require unnecessary equality comparisons which are potentially expensive. Instead, a switch should occur on a predictable and fast integer (or long) function value computed from the string. The most natural choice for this function is String.hashCode, but other functions could also be used either alone or in conjunction with hashcode. (The specification of String.hashCode is assumed to be stable at this point.) If all the string labels have different lengths, String.length() could be used instead of hashcode. Generally a String.equals() check will be needed to verify the candidate string's identity in addition to the evaluation of the screening function because multiple string inputs could evaluate to the same result. A single case label, a single case label with a default, and two case labels can be special-cased to just equality checks without function evaluations. If there are collisions in String.hashCode on the set of case labels in a switch block, a different function without collisions on that set of inputs should be used; for example ((long)s.hashcode<<32 ) + s.length()) is another candidate function. Here are desugarings to currently legal Java source for the two examples above where the default hash code do not collide: // Simple Example if (s.equals("foo")) { // cause NPE if s is null processfoo(s); } // Advanced example { // new scope for synthetic variables boolean The semantics of existing class files and legal source files and are unchanged by this feature. REFERENCES EXISTING BUGS: Please include a list of any existing Sun bug ids related to this proposal Using Strings and Objects in Switch case statements. URL FOR PROTOTYPE (optional): No prototype at this time. 33 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

34 Strings in switch spec and implementation What is there to discuss? What does switching on a null do? Can null be a case label? JDK 7 implementation relies on a particular algorithm be used for String.hashCode Many other implementation options Secondary hash if collisions on primary hash Perfect hash functions Labeled-break 34 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

35 Project Coin: Taking a Break for Strings in Switch static void f(string s) { // Original sugared code switch (s) { case "azvl": System.out.println("azvl: "+s); // fallthrough case "quux": System.out.println("Quux: "+s); // fallthrough case "foo": int i = 5; //fallthrough case "bar": System.out.println("FooOrBar " + (i = 6) + ": "+s); break; case "bmjrabc": // same hash as "azvl" System.out.println("bmjrabc: "+s); break; case "baz": System.out.println("Baz " + (i = 7) + ": "+s); // fallthrough default: System.out.println("default: "+s); } } 35 Copyright 2012, Oracle and/or its affiliates. All rights reserved. static void f(string s) { // Desugared code $exit: { int i$foo = 0; $default_label: { $baz: { $bmjrabc: { $bar: { $foo: { $quux: { $azvl: { switch(s.hashcode()) { // cause NPE if s is null case : // "azvl" and "bmjrabc".hashcode() if (s.equals("azvl")) break $azvl; else if (s.equals("bmjrabc")) break $bmjrabc; else break $default_label; case : // "quux".hashcode() if (!s.equals("quux")) // inequality compare break $default_label; break $quux; case : // "foo".hashcode() if (s.equals("foo")) // equality compare break $foo; break $default_label; case 97299: // "bar".hashcode() if (!s.equals("bar")) break $default_label; break $bar; case 97307: // "baz".hashcode() if (!s.equals("baz")) break $default_label; break $baz; default: break $default_label; }//switch }//azvl System.out.println("azvl: "+s); // fallthrough } //quux System.out.println("Quux: "+s); // fallthrough } //foo i$foo = 5; }//bar System.out.println("FooOrBar " + (i$foo = 6) + ": "+s); break $exit; }//bmjrabc System.out.println("bmjrabc: " + s); break $exit; } //baz System.out.println("Baz " + (i$foo = 7) + ": "+s); // fallthrough }//default_label System.out.println("default: "+s); }//exit }

36 Strings in switch implementation history Original changeset quickly followed by small refinement Bug fix in JDK 7u2: switch(s) { case("a"): // Extra parentheses // would crash javac 36 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

37 3. SafeVarargs Background Often preferable to have a sound system of warnings No missed cases (no false negatives) But may have false positives 37 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

38 the [Java] language is designed to guarantee that if your entire application has been compiled without unchecked warnings [ ], it is type safe. Generics in the Java Programming Language Gilad Bracha 38 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

39 Unchecked warnings To make sure that potential violations of the typing rules are always flagged, some accesses to members of a raw type will result in compile-time unchecked warnings. The rules for compile-time unchecked warnings when accessing members or constructors of raw types are as follows: JLS 4.8 Raw Types 39 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

40 Heap Pollution Heap pollution can only occur if the program performed some operation involving a raw type that would give rise to a compile-time unchecked warning [ ] or if the program aliases an array variable of non-reifiable element type through an array variable of a supertype which is either raw or non-generic. JLS Variables of Reference Type 40 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

41 Unchecked Warnings and Soundness Unchecked warnings are intended to be a sound analysis From a certain point of view, it is correct to always emit an unchecked warning (but unhelpful!) Pre-JDK 7, always got an unchecked warning when calling certain varargs library methods Bad, and complicated interaction between generics and arrays But usually nothing dangerous really happens! 41 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

42 Limits of SafeVarargs Impractical to standardize a sufficiently powerful sound analysis in JDK 7 Just read-only not sufficient Just invariant not sufficient Aliasing complicates analysis Definite assignment/unassignment is tricky Leave such standardization for future work; quality of implementation issue in the meantime 42 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

43 Designing the SafeVarargs annotation type Annotations on methods are not can therefore only be applied to Static methods Constructors final instance methods Additional checks on varargs status, etc. Runtime retention policy 43 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

44 4. Diamond <> Diamond uses type inference to figure out types so the programmer doesn t have to write them Type inference is a constraint satisfaction problem What are the constraints? How can they be satisfied? Want a unique answer returned by the algorithm 44 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

45 Experiments Two inference schemes proposed, differing in how they gathered constraints Each sometimes more useful than the other Use quantitative analysis to help resolve the issue Prototype both schemes Analyze results on millions of files of code 45 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

46 Quantitative Results Both schemes equally effective Each could eliminate a different 90% of the explicit type parameters to constructor calls We verified diamond was a worthwhile feature! Choose inference scheme with better evolution and maintenance properties Language designer's notebook: Quantitative language design 46 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

47 Hofstadter s Law: It always takes longer than you expect, even when you take into account Hofstadter s Law. Douglas Hofstadter Gödel, Escher, Bach: An Eternal Golden Braid 47 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

48 Law of Evolving the Java Language: There are always more interactions than you expect, even when you expect lots of interactions. CUSTOMER LOGO 48 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

49 Diamond and anonymous classes public class Box<T> { private T value; Object o; List<?> arg =...; o = new Box<>(arg); } public Box(T value) { this.value = value; } T getvalue() { return value; } 49 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

50 Object o; List<?> arg =...; o = new Box<List<capture of?> >(arg); 50 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

51 Object o; List<?> arg =...; o = new Box<List<capture of?> >(arg){ }; 51 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

52 Object o; List<?> arg =...; o = new a$1(arg); Anonymous classes translate into a new class file with a full set of attributes. class a$1 extends Box<List<capture of?> >{ } 52 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

53 Diamond and generic constructors class Foo<T extends Number> { // The rare generic constructor! <S extends T> Foo(S s) {super();} } Class Constructor Supported Example Explicit Explicit Yes new <Integer> Foo<Number>(null); Explicit Inferred Yes new Foo<Number>(null); Inferred Inferred Yes new Foo<>(null); Inferred Explicit No new <Integer> Foo<>(null); // compile error Project Coin: Diamond and Generic Constructors 53 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

54 5. Multi-catch and more precise rethrow Does it matter if this code doesn t compile in JDK 7? try { throw new DaughterOfFoo(); } catch (Foo exception) { try { // Pre-JDK 7 throws Foo, now throws DaughterOfFoo throw exception; } catch (SonOfFoo anotherexception) { ; // Reachable? } } 54 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

55 Multi-catch evolution Reformulated rules for can-throw computation Developed effectively final analysis What is the meaning of catch(foo SonOfFoo e) { } Explicitly disallowed in JDK 7 Could be added later 55 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

56 6. try-with-resources Largest of the Coins Syntax changes Allow trailing ; in resource list Require full declaration of resource variable inside try( ) Changes to semantics of desugaring Suppress only Exceptions or all Throwables? Null handling Throwable changes for suppression AutoCloseable and InterruptedException 56 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

57 Implementation Effort try-with-resources Multi-catch and precise rethrow Strings in switch Diamond Improved Design Effort 57 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

58 Submitted Proposals Per Day Total Submitted Proposals Project Coin proposals in JDK Days after Opening 0 58 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

59 Project Coin discussions in JDK ! Monthly Messages Total Note: Log scale Copyright 2012, Oracle and/or its affiliates. All rights reserved.

60 JSR 334 in the Java Community Process Expert Group Formation Early Draft Review Public Review Jan 11, 2011 March 24, 2011 Proposed Final Draft June 24, 2011 JSR Approval Ballot Dec 06, 2010 July 5, 2011 Final Approval Ballot JSR Proposal Nov 16, 2010 July 18, 2011 Final Release 60 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

61 Project Coin changes in JDK 7 Methodical and quantitative approach Decide today what needs to be decided today Consciously leave room for future decisions Language + library co-evolution Smooth transition to new features Widespread tool support Use of new features reads well What about JDK 8? 61 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

62 (Very) Small Language changes Under consideration for JDK 8 Only opportunistic changes given scope of Lambda and Jigsaw Refinements to JDK 7 Project Coin features try-with-resources on an effectively final variable? Remove some restrictions on on a private method? Repeating annotations Parameter names available at runtime 62 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

63 The way ahead JDK Enhancement-Proposal & Roadmap Process Proposed JDK 8 language changes will appear as JEPs Any future full-scale Coin effort would interface with the JEP process 63 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

64 64 Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Oracle Corporation

Oracle Corporation 1 2011 Oracle Corporation Making heads and tails of Project Coin, Small language changes in JDK 7 Joseph D. Darcy Presenting with LOGO 2 2011 Oracle Corporation Project Coin is a suite of language and

More information

<Insert Picture Here> Project Coin: Small Language Changes for JDK 7 & JSR 334: Small Language Changes for Java SE 7

<Insert Picture Here> Project Coin: Small Language Changes for JDK 7 & JSR 334: Small Language Changes for Java SE 7 1 Project Coin: Small Language Changes for JDK 7 & JSR 334: Small Language Changes for Java SE 7 Joseph D. Darcy Java Platform Group The following is intended to outline our general

More information

JDK 7 (2011.7) knight76.tistory.com Knight76 at gmail.com

JDK 7 (2011.7) knight76.tistory.com Knight76 at gmail.com JDK 7 (2011.7) JDK 7 #2 Project Coin knight76.tistory.com Knight76 at gmail.com 1 Project Coin 2 Project Leader Joseph D. Darcy( ) IDEA 2 27, 2009 3 30, 2009 (open call) 70 jdk 7, Language, The Java programming-language

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring Java Outline Java Models for variables Types and type checking, type safety Interpretation vs. compilation Reasoning about code CSCI 2600 Spring 2017 2 Java Java is a successor to a number of languages,

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

Index COPYRIGHTED MATERIAL

Index COPYRIGHTED MATERIAL Index COPYRIGHTED MATERIAL Note to the Reader: Throughout this index boldfaced page numbers indicate primary discussions of a topic. Italicized page numbers indicate illustrations. A abstract classes

More information

interface MyAnno interface str( ) val( )

interface MyAnno interface str( ) val( ) Unit 4 Annotations: basics of annotation-the Annotated element Interface. Using Default Values, Marker Annotations. Single-Member Annotations. The Built-In Annotations-Some Restrictions. 1 annotation Since

More information

A Third Look At Java. Chapter Seventeen Modern Programming Languages, 2nd ed. 1

A Third Look At Java. Chapter Seventeen Modern Programming Languages, 2nd ed. 1 A Third Look At Java Chapter Seventeen Modern Programming Languages, 2nd ed. 1 A Little Demo public class Test { public static void main(string[] args) { int i = Integer.parseInt(args[0]); int j = Integer.parseInt(args[1]);

More information

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17 List of Programs xxv List of Figures xxix List of Tables xxxiii Preface to second version xxxv PART 1 Structured Programming 1 1 Getting started 3 1.1 Programming 3 1.2 Editing source code 5 Source code

More information

CHAPTER 1 JAVA 7 FEATURES

CHAPTER 1 JAVA 7 FEATURES CHAPTER 1 JAVA 7 FEATURES OBJECTIVES After completing Java 7 Features, you will be able to: Identify and use new features of the Java language available as of the 7 th edition: Binary literals and underscore

More information

Classes, interfaces, & documentation. Review of basic building blocks

Classes, interfaces, & documentation. Review of basic building blocks Classes, interfaces, & documentation Review of basic building blocks Objects Data structures literally, storage containers for data constitute object knowledge or state Operations an object can perform

More information

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix PGJC4_JSE8_OCA.book Page ix Monday, June 20, 2016 2:31 PM Contents Figures Tables Examples Foreword Preface xix xxi xxiii xxvii xxix 1 Basics of Java Programming 1 1.1 Introduction 2 1.2 Classes 2 Declaring

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Eclipse and Java 8. Daniel Megert Platform and JDT Lead Eclipse PMC Member IBM Rational Zurich Research Lab

Eclipse and Java 8. Daniel Megert Platform and JDT Lead Eclipse PMC Member IBM Rational Zurich Research Lab Eclipse and Java 8 Daniel Megert Platform and JDT Lead Eclipse PMC Member IBM Rational Zurich Research Lab Eclipse and Java 8 New Java language features Eclipse features for Java 8 (demo) Behind the scenes

More information

Java Fundamentals (II)

Java Fundamentals (II) Chair of Software Engineering Languages in Depth Series: Java Programming Prof. Dr. Bertrand Meyer Java Fundamentals (II) Marco Piccioni static imports Introduced in 5.0 Imported static members of a class

More information

Metadata Features in Java SE 8

Metadata Features in Java SE 8 Metadata Features in Java SE 8 Joel Borggrén-Franck Java Platform Group Oracle @joelbf Metadata Features in Java SE 8 Joel Borggrén-Franck Java Platform Group Oracle @joelbf First, a message from our lawyers:

More information

Class, Variable, Constructor, Object, Method Questions

Class, Variable, Constructor, Object, Method Questions Class, Variable, Constructor, Object, Method Questions http://www.wideskills.com/java-interview-questions/java-classes-andobjects-interview-questions https://www.careerride.com/java-objects-classes-methods.aspx

More information

Introduce C# as Object Oriented programming language. Explain, tokens,

Introduce C# as Object Oriented programming language. Explain, tokens, Module 2 98 Assignment 1 Introduce C# as Object Oriented programming language. Explain, tokens, lexicals and control flow constructs. 99 The C# Family Tree C Platform Independence C++ Object Orientation

More information

WA1278 Introduction to Java Using Eclipse

WA1278 Introduction to Java Using Eclipse Lincoln Land Community College Capital City Training Center 130 West Mason Springfield, IL 62702 217-782-7436 www.llcc.edu/cctc WA1278 Introduction to Java Using Eclipse This course introduces the Java

More information

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content Core Java - SCJP Course content NOTE: For exam objectives refer to the SCJP 1.6 objectives. 1. Declarations and Access Control Java Refresher Identifiers & JavaBeans Legal Identifiers. Sun's Java Code

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 04: Exception Handling MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Creating Classes 2 Introduction Exception Handling Common Exceptions Exceptions with Methods Assertions and

More information

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler Front-End

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler Front-End Outline Semantic Analysis The role of semantic analysis in a compiler A laundry list of tasks Scope Static vs. Dynamic scoping Implementation: symbol tables Types Static analyses that detect type errors

More information

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS Chapter 1 : Chapter-wise Java Multiple Choice Questions and Answers Interview MCQs Java Programming questions and answers with explanation for interview, competitive examination and entrance test. Fully

More information

Project Lambda in Java SE 8

Project Lambda in Java SE 8 Project Lambda in Java SE 8 Daniel Smith Java Language Designer 1 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated

More information

The Java Programming Language

The Java Programming Language The Java Programming Language Slide by John Mitchell (http://www.stanford.edu/class/cs242/slides/) Outline Language Overview History and design goals Classes and Inheritance Object features Encapsulation

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

The role of semantic analysis in a compiler

The role of semantic analysis in a compiler Semantic Analysis Outline The role of semantic analysis in a compiler A laundry list of tasks Scope Static vs. Dynamic scoping Implementation: symbol tables Types Static analyses that detect type errors

More information

<Insert Picture Here> OpenJDK - When And How To Contribute To The Java SE Reference Implementation OSCON 2011, July 26th, 2011

<Insert Picture Here> OpenJDK - When And How To Contribute To The Java SE Reference Implementation OSCON 2011, July 26th, 2011 OpenJDK - When And How To Contribute To The Java SE Reference Implementation OSCON 2011, July 26th, 2011 Dalibor Topić Java F/OSS Ambassador The following is intended to outline our

More information

Annotation File Specification

Annotation File Specification Annotation File Specification Javari Team MIT Computer Science and Artificial Intelligence Lab javari@csail.mit.edu October 2, 2007 1 Purpose: External storage of annotations Java annotations are meta-data

More information

JPred-P 2. Josh Choi, Michael Welch {joshchoi,

JPred-P 2. Josh Choi, Michael Welch {joshchoi, JPred-P 2 Josh Choi, Michael Welch {joshchoi, mjwelch}@cs.ucla.edu 1. Introduction Precondition and postcondition checking on methods aids the development process by explicitly notifying the programmer

More information

Java Bytecode (binary file)

Java Bytecode (binary file) Java is Compiled Unlike Python, which is an interpreted langauge, Java code is compiled. In Java, a compiler reads in a Java source file (the code that we write), and it translates that code into bytecode.

More information

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java Introduction Objectives An overview of object-oriented concepts. Programming and programming languages An introduction to Java 1-2 Problem Solving The purpose of writing a program is to solve a problem

More information

Getting started with Java

Getting started with Java Getting started with Java by Vlad Costel Ungureanu for Learn Stuff Programming Languages A programming language is a formal constructed language designed to communicate instructions to a machine, particularly

More information

Objectives for this class meeting. 1. Conduct review of core concepts concerning contracts and pre/post conditions

Objectives for this class meeting. 1. Conduct review of core concepts concerning contracts and pre/post conditions CSE1720 Click to edit Master Week text 01, styles Lecture 02 Second level Third level Fourth level Fifth level Winter 2015! Thursday, Jan 8, 2015 1 Objectives for this class meeting 1. Conduct review of

More information

JDK 9 Language, Tooling, and Library Features More than modules! #JDK9LangToolsLibs

JDK 9 Language, Tooling, and Library Features More than modules! #JDK9LangToolsLibs JDK 9 Language, Tooling, and Library Features More than modules! Joseph D. Darcy (@jddarcy) Java Platform Group Oracle October 3, 2017 1 Safe Harbor Statement The following is intended to outline our general

More information

Java: framework overview and in-the-small features

Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

Rules and syntax for inheritance. The boring stuff

Rules and syntax for inheritance. The boring stuff Rules and syntax for inheritance The boring stuff The compiler adds a call to super() Unless you explicitly call the constructor of the superclass, using super(), the compiler will add such a call for

More information

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2 CS321 Languages and Compiler Design I Winter 2012 Lecture 2 1 A (RE-)INTRODUCTION TO JAVA FOR C++/C PROGRAMMERS Why Java? Developed by Sun Microsystems (now Oracle) beginning in 1995. Conceived as a better,

More information

Java: introduction to object-oriented features

Java: introduction to object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: introduction to object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

Assoc. Prof. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Assoc. Prof. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved. Assoc. Prof. Marenglen Biba Exception handling Exception an indication of a problem that occurs during a program s execution. The name exception implies that the problem occurs infrequently. With exception

More information

CS 11 java track: lecture 1

CS 11 java track: lecture 1 CS 11 java track: lecture 1 Administrivia need a CS cluster account http://www.cs.caltech.edu/ cgi-bin/sysadmin/account_request.cgi need to know UNIX www.its.caltech.edu/its/facilities/labsclusters/ unix/unixtutorial.shtml

More information

Announcements. Working on requirements this week Work on design, implementation. Types. Lecture 17 CS 169. Outline. Java Types

Announcements. Working on requirements this week Work on design, implementation. Types. Lecture 17 CS 169. Outline. Java Types Announcements Types Working on requirements this week Work on design, implementation Lecture 17 CS 169 Prof. Brewer CS 169 Lecture 16 1 Prof. Brewer CS 169 Lecture 16 2 Outline Type concepts Where do types

More information

SYLLABUS JAVA COURSE DETAILS. DURATION: 60 Hours. With Live Hands-on Sessions J P I N F O T E C H

SYLLABUS JAVA COURSE DETAILS. DURATION: 60 Hours. With Live Hands-on Sessions J P I N F O T E C H JAVA COURSE DETAILS DURATION: 60 Hours With Live Hands-on Sessions J P I N F O T E C H P U D U C H E R R Y O F F I C E : # 4 5, K a m a r a j S a l a i, T h a t t a n c h a v a d y, P u d u c h e r r y

More information

Introduction to Java Programming

Introduction to Java Programming Introduction to Java Programming Lecture 1 CGS 3416 Spring 2017 1/9/2017 Main Components of a computer CPU - Central Processing Unit: The brain of the computer ISA - Instruction Set Architecture: the specific

More information

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS Java language Part 1. Java fundamentals Yevhen Berkunskyi, NUoS eugeny.berkunsky@gmail.com http://www.berkut.mk.ua What Java is? Programming language Platform: Hardware Software OS: Windows, Linux, Solaris,

More information

Introduction to Ceylon. Stéphane Épardaud Red Hat

Introduction to Ceylon. Stéphane Épardaud Red Hat Introduction to Ceylon Stéphane Épardaud Red Hat Executive summary What is Ceylon Why Ceylon Features and feel Demo The community Status 2 About Stéphane Épardaud Open-Source projects RESTEasy, Ceylon

More information

Name Definition Example Differences

Name Definition Example Differences Big Integer Instantiation Don't create instances of already existing BigInteger (BigInteger.ZERO, BigInteger.ONE) andfor Java 1.5 onwards, BigInteger.TEN and BigDecimal (BigDecimal.ZERO, BigDecimal.ONE,

More information

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler so far

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler so far Outline Semantic Analysis The role of semantic analysis in a compiler A laundry list of tasks Scope Static vs. Dynamic scoping Implementation: symbol tables Types Statically vs. Dynamically typed languages

More information

Future of Java. Post-JDK 9 Candidate Features. Jan Lahoda Java compiler developer Java Product Group, Oracle September, 2017

Future of Java. Post-JDK 9 Candidate Features. Jan Lahoda Java compiler developer Java Product Group, Oracle September, 2017 Future of Java Post-JDK 9 Candidate Features Jan Lahoda Java compiler developer Java Product Group, Oracle September, 2017 Safe Harbor Statement The following is intended to outline our general product

More information

Program Correctness and Efficiency. Chapter 2

Program Correctness and Efficiency. Chapter 2 Program Correctness and Efficiency Chapter 2 Chapter Objectives To understand the differences between the three categories of program errors To understand the effect of an uncaught exception and why you

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 04: Exception Handling MOUNA KACEM mouna@cs.wisc.edu Spring 2018 Creating Classes 2 Introduction Exception Handling Common Exceptions Exceptions with Methods Assertions

More information

Programming Lecture 3

Programming Lecture 3 Five-Minute Review 1. What is a variable? 2. What is a class? An object? 3. What is a package? 4. What is a method? A constructor? 5. What is an object variable? 1 Programming Lecture 3 Expressions etc.

More information

Anatomy of a Compiler. Overview of Semantic Analysis. The Compiler So Far. Why a Separate Semantic Analysis?

Anatomy of a Compiler. Overview of Semantic Analysis. The Compiler So Far. Why a Separate Semantic Analysis? Anatomy of a Compiler Program (character stream) Lexical Analyzer (Scanner) Syntax Analyzer (Parser) Semantic Analysis Parse Tree Intermediate Code Generator Intermediate Code Optimizer Code Generator

More information

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017 Introduction to Java Lecture 1 COP 3252 Summer 2017 May 16, 2017 The Java Language Java is a programming language that evolved from C++ Both are object-oriented They both have much of the same syntax Began

More information

<Insert Picture Here> JSR-335 Update for JCP EC Meeting, January 2012

<Insert Picture Here> JSR-335 Update for JCP EC Meeting, January 2012 JSR-335 Update for JCP EC Meeting, January 2012 Alex Buckley Oracle Corporation The following is intended to outline our general product direction. It is intended for information

More information

Using Type Annotations to Improve Your Code

Using Type Annotations to Improve Your Code Using Type Annotations to Improve Your Code Birds-of-a-Feather Session Werner Dietl, University of Waterloo Michael Ernst, University of Washington Open for questions Survey: Did you attend the tutorial?

More information

6.005 Elements of Software Construction Fall 2008

6.005 Elements of Software Construction Fall 2008 MIT OpenCourseWare http://ocw.mit.edu 6.005 Elements of Software Construction Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.005 elements

More information

Java SE 8 Programming

Java SE 8 Programming Oracle University Contact Us: +52 1 55 8525 3225 Java SE 8 Programming Duration: 5 Days What you will learn This Java SE 8 Programming training covers the core language features and Application Programming

More information

Java Programming Tutorial 1

Java Programming Tutorial 1 Java Programming Tutorial 1 Every programming language has two defining characteristics: Syntax Semantics Programming Writing code with good style also provides the following benefits: It improves the

More information

About this exam review

About this exam review Final Exam Review About this exam review I ve prepared an outline of the material covered in class May not be totally complete! Exam may ask about things that were covered in class but not in this review

More information

JVA-103. Java Programming

JVA-103. Java Programming JVA-103. Java Programming Version 8.0 This course teaches programming in the Java language -- i.e. the Java Standard Edition platform. It is intended for programmers with experience in languages other

More information

Oracle Corporation OSCON 2012

Oracle Corporation OSCON 2012 1 2012 Oracle Corporation OSCON 2012 Reducing Technical Debt in OpenJDK The Legacy and the Burden Stuart W. Marks Oracle JDK Core Libraries Group 2 2012 Oracle Corporation OSCON 2012 Let s Look At Some

More information

Lexical Considerations

Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2005 Handout 6 Decaf Language Wednesday, September 7 The project for the course is to write a

More information

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Forth Meets Smalltalk. A Presentation to SVFIG October 23, 2010 by Douglas B. Hoffman

Forth Meets Smalltalk. A Presentation to SVFIG October 23, 2010 by Douglas B. Hoffman Forth Meets Smalltalk A Presentation to SVFIG October 23, 2010 by Douglas B. Hoffman 1 CONTENTS WHY FMS? NEON HERITAGE SMALLTALK HERITAGE TERMINOLOGY EXAMPLE FMS SYNTAX ACCESSING OVERRIDDEN METHODS THE

More information

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline :: Module Title Duration : Intro to JAVA SE7 and Programming using JAVA SE7 : 9 days Course Description The Java SE 7 Fundamentals course was designed to enable students with little or no programming experience

More information

Java Language Modularity With Superpackages

Java Language Modularity With Superpackages Java Language Modularity With Superpackages Alex Buckley JSR 294 Co-spec lead Sun Microsystems Andreas Sterbenz JSR 294 Co-spec lead Sun Microsystems TS-2401 2007 JavaOne SM Conference Session 2401 Goal

More information

Under the Hood: The Java Virtual Machine. Lecture 23 CS2110 Fall 2008

Under the Hood: The Java Virtual Machine. Lecture 23 CS2110 Fall 2008 Under the Hood: The Java Virtual Machine Lecture 23 CS2110 Fall 2008 Compiling for Different Platforms Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized

More information

Annotations in Java. Jeszenszky, Péter University of Debrecen, Faculty of Informatics

Annotations in Java. Jeszenszky, Péter University of Debrecen, Faculty of Informatics Annotations in Java Jeszenszky, Péter University of Debrecen, Faculty of Informatics jeszenszky.peter@inf.unideb.hu Kocsis, Gergely (English version) University of Debrecen, Faculty of Informatics kocsis.gergely@inf.unideb.hu

More information

FindBugs review of Glassfish v2 b09

FindBugs review of Glassfish v2 b09 FindBugs review of Glassfish v2 b09 William Pugh Univ. of Maryland http://www.cs.umd.edu/~pugh/ FindBugs Open source static analysis tool for finding defects in Java programs Analyzes classfiles Generates

More information

CSC Java Programming, Fall Java Data Types and Control Constructs

CSC Java Programming, Fall Java Data Types and Control Constructs CSC 243 - Java Programming, Fall 2016 Java Data Types and Control Constructs Java Types In general, a type is collection of possible values Main categories of Java types: Primitive/built-in Object/Reference

More information

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont.

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. Today! Build HelloWorld yourself in BlueJ and Eclipse. Look at all the Java keywords. Primitive Types. HelloWorld in BlueJ 1. Find BlueJ in the start menu, but start the Select VM program instead (you

More information

5. Semantic Analysis!

5. Semantic Analysis! 5. Semantic Analysis! Prof. O. Nierstrasz! Thanks to Jens Palsberg and Tony Hosking for their kind permission to reuse and adapt the CS132 and CS502 lecture notes.! http://www.cs.ucla.edu/~palsberg/! http://www.cs.purdue.edu/homes/hosking/!

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Copyright 1992-2015 by Pearson Education, Inc. All Rights Reserved. Data structures Collections of related data items. Discussed in depth in Chapters 16 21. Array objects Data

More information

Java: advanced object-oriented features

Java: advanced object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: advanced object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Packages

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

F1 A Java program. Ch 1 in PPIJ. Introduction to the course. The computer and its workings The algorithm concept

F1 A Java program. Ch 1 in PPIJ. Introduction to the course. The computer and its workings The algorithm concept F1 A Java program Ch 1 in PPIJ Introduction to the course The computer and its workings The algorithm concept The structure of a Java program Classes and methods Variables Program statements Comments Naming

More information

Two Key JDK 10 Features

Two Key JDK 10 Features Supplement to Java: The Complete Reference, Tenth Edition Two Key JDK 10 Features This supplement to Java: The Complete Reference, Tenth Edition discusses two key features added by JDK 10. It is provided

More information

Exceptions. References. Exceptions. Exceptional Conditions. CSE 413, Autumn 2005 Programming Languages

Exceptions. References. Exceptions. Exceptional Conditions. CSE 413, Autumn 2005 Programming Languages References Exceptions "Handling Errors with Exceptions", Java tutorial http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html CSE 413, Autumn 2005 Programming Languages http://www.cs.washington.edu/education/courses/413/05au/

More information

3. Convert 2E from hexadecimal to decimal. 4. Convert from binary to hexadecimal

3. Convert 2E from hexadecimal to decimal. 4. Convert from binary to hexadecimal APCS A Midterm Review You will have a copy of the one page Java Quick Reference sheet. This is the same reference that will be available to you when you take the AP Computer Science exam. 1. n bits can

More information

5/23/2015. Core Java Syllabus. VikRam ShaRma

5/23/2015. Core Java Syllabus. VikRam ShaRma 5/23/2015 Core Java Syllabus VikRam ShaRma Basic Concepts of Core Java 1 Introduction to Java 1.1 Need of java i.e. History 1.2 What is java? 1.3 Java Buzzwords 1.4 JDK JRE JVM JIT - Java Compiler 1.5

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Fall 2016 Lecture 3a Andrew Tolmach Portland State University 1994-2016 Formal Semantics Goal: rigorous and unambiguous definition in terms of a wellunderstood formalism (e.g.

More information

Introduction to Java

Introduction to Java Introduction to Java Module 1: Getting started, Java Basics 22/01/2010 Prepared by Chris Panayiotou for EPL 233 1 Lab Objectives o Objective: Learn how to write, compile and execute HelloWorld.java Learn

More information

Java SE 8 Programming

Java SE 8 Programming Java SE 8 Programming Training Calendar Date Training Time Location 16 September 2019 5 Days Bilginç IT Academy 28 October 2019 5 Days Bilginç IT Academy Training Details Training Time : 5 Days Capacity

More information

Programming Kotlin. Familiarize yourself with all of Kotlin s features with this in-depth guide. Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI

Programming Kotlin. Familiarize yourself with all of Kotlin s features with this in-depth guide. Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI Programming Kotlin Familiarize yourself with all of Kotlin s features with this in-depth guide Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI Programming Kotlin Copyright 2017 Packt Publishing First

More information

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Language Features. 1. The primitive types int, double, and boolean are part of the AP Language Features 1. The primitive types int, double, and boolean are part of the AP short, long, byte, char, and float are not in the subset. In particular, students need not be aware that strings are

More information

Programming Lecture 3

Programming Lecture 3 Five-Minute Review 1. What is a variable? 2. What is a class? An object? 3. What is a package? 4. What is a method? A constructor? 5. What is an object variable? 1 Programming Lecture 3 Expressions etc.

More information

Java SE 8 Programming

Java SE 8 Programming Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Java SE 8 Programming Duration: 5 Days What you will learn This Java SE 8 Programming training covers the core language features

More information

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures Dan Grossman Fall 2014 Hi! I m not Hal J I love this stuff and have taught

More information

Decaf Language Reference Manual

Decaf Language Reference Manual Decaf Language Reference Manual C. R. Ramakrishnan Department of Computer Science SUNY at Stony Brook Stony Brook, NY 11794-4400 cram@cs.stonybrook.edu February 12, 2012 Decaf is a small object oriented

More information

Points To Remember for SCJP

Points To Remember for SCJP Points To Remember for SCJP www.techfaq360.com The datatype in a switch statement must be convertible to int, i.e., only byte, short, char and int can be used in a switch statement, and the range of the

More information

Jam: A Smooth Extension With Java Mixins

Jam: A Smooth Extension With Java Mixins Jam: A Smooth Extension With Java Mixins Davide Ancona, Giovanni Lagorio, Ellena Zucca Presentation created by Left-out Jam abstract syntax Formal definitions of Jam static semantics Formal definitions

More information

Programming Lecture 3

Programming Lecture 3 Five-Minute Review 1. What is a variable? 2. What is a class? An object? 3. What is a package? 4. What is a method? A constructor? 5. What is an object variable? 1 Programming Lecture 3 Expressions etc.

More information