Over a million developers have joined DZone.

IdGenerator In Java

·
// IdGenerator


public class IdGenerator {
	
	private long maxId; 
	
	public IdGenerator(long start) {
		maxId = start;
	}
	
	public long getNextId () {
		return ++maxId;
	}

} // IdGenerator
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}