j2se

TwitterFacebook
Get flash to fully experience Pearltrees

Java 7: Project Coin in code examples

http://java.dzone.com/articles/java-7-project-coin-code We Recommend These Resources This blog introduces - by code examples - some new Java 7 features summarized under the term Project Coin . The goal of Project Coin is to add a set of small language changes to JDK 7. These changes do simplify the Java language syntax. Less typing, cleaner code, happy developer ;-) Let's look into that.
http://cleveralias.blogs.com/thought_spearmints/2006/01/suppresswarning.html I cooked up a toy Java 5 class that generates warnings of the "unchecked" family when compiled: package pholser.util; import java.util.Arrays; public class Stack<T> { private final Object[] storage; private int top; public Stack() { this.storage = new Object[ 5 ]; } public Stack( final Stack<T> other ) { this.storage = (Object[]) other.storage.clone(); this.top = other.top; final T currentTop = (T) storage[ top ]; } public void push( final T item ) { checkPrecondition( isFull(), "can't push a full stack" ); storage[ top++ ] = item; } public T pop() { checkPrecondition( isEmpty(), "can't pop an empty stack" ); return (T) storage[ --top ]; } public T peek() { checkPrecondition( isEmpty(), "can't peek an empty stack" ); return (T) storage[ --top ]; } @Override public boolean equals( final Object that ) { if ( this == that ) return true; if ( that == null || !getClass().equals( that.getClass() ) ) return false; final Stack<?> other = (Stack<?

Thought Spearmints: @SuppressWarnings and its applicability to various program elements

Eamonn McManus's Blog: Getting rid of unchecked warnings for casts

Posted by emcmanus on March 30, 2007 at 3:27 AM PDT If you've ever made a serious effort to get rid of "unchecked" warnings from the Java compiler (the ones it gives you with -Xlint:unchecked) then you'll probably have found some cases where you know a cast is correct but you can't convince the compiler of it. Is there anything better than adding @SuppressWarnings("unchecked") around the whole method? http://weblogs.java.net/blog/emcmanus/archive/2007/03/getting_rid_of.html
http://javarevisited.blogspot.com/2011/08/enum-in-java-example-tutorial.html What is Enum in Java Enum in Java is a keyword, a feature which is used to represent fixed number of well known values in Java, For example Number of days in Week, Number of planets in Solar system etc. Enumeration (Enum) in Java was introduced in JDK 1.5 and it is one of my favorite features of J2SE 5 among Autoboxing and unboxing , Generics , varargs and static import . Java Enum as type is more suitable on certain cases for example representing state of Order as NEW, PARTIAL FILL, FILL or CLOSED. Enumeration(Enum) was not originally available in Java though it was available in other language like C and C++ but eventually Java realized and introduced Enum on JDK 5 (Tiger) by keyword Enum . In this Java Enum tutorial we will see different Enum example in Java and learn using Enum in Java.

10 examples of Enum in Java - http://javarevisited.blogspot.com/

Oracle submitted the release content for both Java SE 7 and 8 to the JCP at the end of last year. The JDK 7 and 8 JSRs represented Oracle's "Plan B" approach for separating JDK 7 into two separate releases. In the months since, JDK 7 has progressed to the Developer Preview milestone and the final version isn't too far off.

Get Ready for Java 7 with the Free JDK 7 Reference Card

http://www.developer.com/java/get-ready-for-java-7-with-the-free-jdk-7-reference-card.html
Java Notes . These Java programming notes are written to fill in missing or weak topics in textbooks that I've taught from. Many pages are useful for reference, but not as an ordered tutorial. Some pages are still rough drafts, but I'm slowly working on fixing them. notes-java- 2007-04-25 .zip [2.4 MB]. Java Basics .

Java Programming Notes

http://www.leepoint.net/notes-java/index.html
libraries

http://www.onjava.com/pub/a/onjava/2002/10/02/javanio.html

Top Ten New Things You Can Do with NIO

<a href="http://adserver.adtechus.com/adlink/3.0/5159/425846/0/16/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" target="_blank"><img src="http://adserver.adtechus.com/adserv/3.0/5159/425846/0/16/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" border="0" width="1" height="1"></a> New I/O? Why do we need a new I/O? What's wrong with the old I/O?
Many APIs require a fair amount of boilerplate code. For example, in order to write a JAX-RPC web service, you must provide a paired interface and implementation. This boilerplate could be generated automatically by a tool if the program were “decorated” with annotations indicating which methods were remotely accessible. Other APIs require “side files” to be maintained in parallel with programs. For example JavaBeans requires a BeanInfo class to be maintained in parallel with a bean, and Enterprise JavaBeans (EJB) requires a deployment descriptor . http://docs.oracle.com/javase/1.5.0/docs/guide/language/annotations.html

Annotations

Generics