Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java 7 new features

697 views

Published on

Published in: Technology, News & Politics
  • According to Stanford Medical, It's really the ONLY reason this country's woman live 10 years longer and weigh on average 42 pounds lighter than us. ?? (And by the way, it has NOTHING to do with genetics or some secret-exercise and EVERYTHING to do with "how" they eat.) BTW, I said "HOW", not "what"... ?? >> to see if this short quiz can help you unlock your true weight loss potential ♥♥♥ http://ishbv.com/poundinc/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • D.I.Y. 10 Second Flavor-Pairing Trick for Female Weight Loss: CLICK HERE: Instructions and Weight-Loss Doubling Success Stories... ♥♥♥ http://t.cn/AiYhcYmI
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Can You Spare 1 Minute Per Day? If you have a few spare minutes per day, we have some very exciting news for you! ♥♥♥ https://tinyurl.com/1minweight4u
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • how to lose belly fat fast - 22 ways to lose 2 inches in 2 weeks ▲▲▲ http://ishbv.com/bkfitness3/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Java 7 new features

  1. 1. Java 7 New Features
  2. 2. Diamond OperatorMap<String, List<Offer>> offers = new HashMap<>();
  3. 3. Strings in switch statementsString status = offer.getStatus();switch(status) {case NEW: newOffer(offer); Case Label break;case PENDING: toString() pendingOffer(offer); break;default: break;}
  4. 4. Automatic Resource Management Automatic close Multiple Resourcestry(FileOutputStream fos = new FileOutputStream(“movies.txt”);DataOutputStream dos = new DataOutputStream(fos)) { dos.writeUTF(“Java 7 New Features”)} catch (IOException e) { ...} Implements java.lang.AutoCloseable try-with-resources statement
  5. 5. Numeric literals with underscore int thousand = 1_000; int million = 1_000_000;
  6. 6. Binary literals int two = 0b10; int forty = 0b101_000;
  7. 7. Improved exception handlingtry { methodThatThrowsThreeExceptions();} catch (ExceptionOne | ExceptionTwo | ExceptionThree e) { ...} Multi-catch block
  8. 8. NIO 2.0● Working with Path: Path, Paths, FileSystem, FileSystems, ...● File change notifications: WatchService, WatchKey
  9. 9. Fork and Join Framework● ForkJoinPool int numberOfProcessors = Runtime.getRunTime().availableProcessors();● RecursiveAction ForkJoinPool pool = new (void compute()) ForkJoinPool(numberOfProcessors) …● RecursiveTask<V> public class BigProblemTask extends (V compute()) RecursiveAction { @Override protected void compute() { // your problem invocation goes here } } … pool.invoke(task);

×