舉報

會員
Java 11 and 12:New Features
Withitsnewsix-monthlyreleasecadence,Javaismovingforwardfaster.Inadditiontoplannedversionreleases,alotofworkiscurrentlybeingundertakenonvariousJavaprojectsatOracle.Inordertomakebestuseofthenewfeaturesintheirapplicationsandlibraries,youmustbewell-versedwiththemostrecentadvancements.Java11and12–NewFeatureswilltakeyouthroughthelatestdevelopmentsinJava,rightfromvariabletypeinferenceandsimplifiedmultithreadingthroughtoperformanceimprovements,whicharecoveredindepthtohelpyoumakeyourapplicationsmoreefficient.ThisbookexplainstherelevanceandapplicabilityofJava'snewfeatures,andanswersyourquestionsonwhethertoinvestinmigratingtonewJavaversionsandwhentomigrate.You'llalsogettogripswithplatformfeatures,suchasAppCDSandnewgarbagecollectors,totuneandoptimizeyourapplication—fromreducedlaunchtimeandlatencytoimprovedperformanceandthroughput.Bytheendofthisbook,youwillbeequippedwithathoroughunderstandingofthenewfeaturesofJava11,12,andProjectAmber,andpossesstheskillstoapplythemwithaviewtoimprovingyourapplication'sperformance.
目錄(274章)
倒序
- coverpage
- Title Page
- Copyright and Credits
- Java 11 and 12 – New Features
- About Packt
- Why subscribe?
- Packt.com
- Contributors
- About the author
- About the reviewer
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Download the color images
- Conventions used
- Get in touch
- Reviews
- Section 1: JDK 10
- Type Inference
- What is type inference?
- Type inference with var
- Compulsory non-null initialization
- Local variables
- Code check – part 1
- Using var with primitive data types
- Type inference with derived classes
- Type inference with interfaces
- Using var with arrays
- Type inference with generics
- Code check – part 2
- Passing inferred variables to a method
- Reassigning values to inferred variables
- Explicit casting with inferred variables
- Assigning null with explicit casting
- Type inference in previous versions of Java
- Type inference in Java 5
- Type inference in Java 7
- Type inference in Java 8
- Challenges
- Limiting the scope of failed assumptions
- Breaking existing code
- Non-denotable types
- Meaningful variable names
- Code refactoring
- Type inference versus dynamic binding
- Summary
- AppCDS
- Technical requirements
- What is CDS?
- Location of the shared archive file
- Manual creation of classes.jsa
- Usage of CDS
- AppCDS
- Benefits of AppCDS
- Enabling application class data archive
- Which application classes to archive
- Creating an application shared archive file
- Using the shared application archive file
- Summary
- Garbage Collector Optimizations
- Technical requirements
- The GC interface
- Benefits
- Driving factors
- Impact
- Parallel full GC for G1 (JEP 307)
- The design goals of G1 GC
- G1 memory
- Sample code
- Understanding G1 GC logs
- Summary
- Miscellaneous Improvements in JDK 10
- Technical requirements
- Mapping JDK 10 features with scopes and JEPs
- Consolidating the JDK forest into a single repository
- Thread-local handshakes
- Removal of the Native-Header Generation Tool (javah)
- Additional Unicode language-tag extensions
- Heap allocation on alternative memory devices
- The experimental Java-based JIT compiler
- Root certificates
- Time-based release versioning
- Summary
- Section 2: JDK 11
- Local Variable Syntax for Lambda Parameters
- Technical requirements
- Lambda expressions
- Explicitly-typed lambda expressions
- Implicitly-typed lambda expressions
- Lambda parameters and type inference with var
- Adding var to lambda parameters
- Adding annotations to lambda parameters
- Summary
- Epsilon GC
- Technical requirements
- The motivation behind Epsilon GC
- Features of Epsilon
- Latency and application performance
- GC-induced overheads versus system overheads
- Extremely short-lived work
- Getting started with the HelloEpsilon GC class
- Which memory area does GC collect – stack or heap?
- Memory pressure testing with Epsilon
- Designing a garbage-free application
- VM interface testing
- Summary
- The HTTP Client API
- Technical requirements
- A quick flashback
- What can you do with HTTP?
- The need for the HTTP Client API
- HTTP Client usage
- A basic example
- The HttpClient class
- Creating an HttpClient instance
- Methods of the HttpClient class
- HttpRequest
- HttpResponse
- Some examples
- Accessing HTML pages using synchronous GET
- Accessing HTML pages using asynchronous GET
- Downloading multiple hosted image files
- Posting form details
- Summary
- ZGC
- Technical requirements
- The motivation
- Features of ZGC
- Getting started with ZGC
- ZGC heap
- ZGC phases
- Colored pointers
- Tuning ZGC
- Summary
- Flight Recorder and Mission Control
- Technical requirements
- The motivation behind JFR
- Features
- Modules
- Getting started with JFR
- Exploring further
- Working with custom events
- Summary
- Miscellaneous Improvements in JDK 11
- Technical requirements
- Listing the JEPs that are used in this chapter
- Nest-based access control
- What is nest-based access?
- Affects of nest-based control
- Dynamic class-file constants
- Improving AArch64 intrinsics
- Removing the Java EE and CORBA modules
- A key agreement with Curve25519 and Curve448
- Unicode 10
- ChaCha20 and Poly1305 cryptographic algorithms
- Launching single file source code programs
- TLS 1.3
- Deprecating the Nashorn JavaScript engine
- JEP 336 – deprecating the pack200 tools and API
- Summary
- Section 3: JDK 12
- Switch Expressions
- Technical requirements
- Issues with traditional switch constructs
- Using switch expressions
- Defining local variables in a switch branch
- Another syntax for switch expressions
- Comparing break with break <return value>
- A preview language feature
- Exhaustive cases
- What can a switch branch execute other than returning a value?
- How not to use labels and continue in switch expressions
- Summary
- Miscellaneous Improvements in JDK 12
- Technical requirements
- Mapping features of JDK 12 scope and JEP
- Shenandoah – a low-pause-time GC
- The microbenchmark suite
- The JVM constants API
- One AArch64 port not two
- Default CDS archives
- What is CDS?
- Enhancing CDS
- Abortable mixed collections for G1
- Promptly return unused committed memory from G1
- Summary
- Section 4: Project Amber
- Enhanced Enums in Project Amber
- A quick background
- An example
- Decompiled enum – behind the scenes
- The state and behavior of enum constants
- Adding states and behaviors to enum constants
- Accessing the state and behavior of enum constants
- Workarounds to access enum constants
- Using inheritance with enum constants
- Adding generics to enums
- Sharper typing of enum constants
- Summary
- Data Classes and Their Usage
- An introduction to data classes
- What is a data class?
- The need to add data classes to the language
- Diving into data classes
- Example of syntax and semantics
- The aggregate and exploded forms of data classes
- Limitations
- Examples from the past – changes to define enums
- Pattern matching with data classes
- Encapsulating the state
- Abstract and non-abstract data classes
- Data classes and inheritance
- Extending an abstract data class
- Implementing interfaces
- Additional variables
- Overriding implicit behaviors
- Additional methods and constructors
- Mutability
- Summary
- Raw String Literals
- Technical requirements
- A quick example
- Issues with existing multiline string values
- A simple task
- Escape sequence hell with traditional string literals
- Concatenation hell with traditional string literals
- Including escape sequences as part of string values
- Strings and regex patterns another hell
- Welcoming raw string literals
- Rewriting using raw strings
- The delimiter (backtick)
- Treating escape values
- Raw string literals versus traditional string literals
- Interpreting escape sequences
- The unescape() method
- The escape() method
- Managing margins
- The align() method
- The indent(int) method
- The overloaded align(int) method
- The detab(int) and entab methods
- The transform() method
- Common examples
- JSON data
- XML data
- File paths
- Database queries
- Summary
- Lambda Leftovers
- Technical requirements
- Marking unused parameters with underscores
- An example of lambda parameters
- The journey of getting there
- Shadowing of lambda parameters
- The existing case of lambda parameters
- Why should lambda parameters overshadow enclosing variables?
- A few of the known issues
- Disambiguation of functional expressions
- Issues with resolving overloaded methods – passing lambdas
- Issues with resolving overloaded methods – passing method references
- The proposed solution
- Summary
- Pattern Matching
- Technical requirements
- Pattern matching
- Existing issues with type testing
- Type test patterns
- Using pattern matching with switch constructs
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-07-02 12:27:40
推薦閱讀
- Spring Boot開發(fā)與測試實戰(zhàn)
- .NET 4.0面向對象編程漫談:基礎篇
- Mastering Kali Linux for Web Penetration Testing
- MySQL從入門到精通(軟件開發(fā)視頻大講堂)
- 圖數(shù)據(jù)庫實戰(zhàn)
- Kivy Cookbook
- Mastering Concurrency Programming with Java 9(Second Edition)
- Hands-On Robotics Programming with C++
- Mastering R for Quantitative Finance
- Learning Swift
- JSP項目開發(fā)情境教程
- JavaScript高級程序設計(第3版)
- 換個姿勢學C語言
- HTML5 for Flash Developers
- jQuery 2.0 Development Cookbook
- OpenCV Computer Vision with Python
- 微機原理與接口實驗指導
- Raspberry Pi:Amazing Projects from Scratch
- 零基礎學交互設計
- Mastering AngularJS Directives
- Swift 4 Programming Cookbook
- 大學計算機應用基礎
- Rails 4 Application Development HOTSHOT
- 小學生Scratch創(chuàng)意編程(視頻教學版)
- HTML5 Graphing and Data Visualization Cookbook
- ASP.NET 4.0編程技術大全
- Node.js開發(fā)實戰(zhàn)
- 軟件是這樣“煉”成的:Java學習全演練
- PhoneGap By Example
- 程序員面試寶典(第三版)