SlideShare a Scribd company logo
1
Java Advanced
Features
Trenton Computer Festival
March 17, 2018
Michael P. Redlich
@mpredli
about.me/mpredli/
Who’s Mike?
• BS in CS from
• “Petrochemical Research Organization”
• Java Queue News Editor, InfoQ
• Ai-Logix, Inc. (now AudioCodes)
• Amateur Computer Group of New Jersey
2
Objectives (1)
• Java Beans
• Exception Handling
• Generics
• Java Database Connectivity
• Java Collections Framework
3
Java Beans
4
What are Java Beans?
• A method for developing reusable Java
components
• Also known as POJOs (Plain Old Java Objects)
• Easily store and retrieve information
5
Java Beans (1)
• A Java class is considered a bean when it:
• implements interface Serializable
• defines a default constructor
• defines properly named getter/setter methods
6
Java Beans (2)
• Getter/Setter methods:
• return (get) and assign (set) a bean’s data
members
• Specified naming convention:
•getMember
•setMember
•isValid
7
8
// PersonBean class (partial listing)
public class PersonBean implements Serializable {
private static final long serialVersionUID = 7526472295622776147L;
private String lastName;
private String firstName;
private boolean valid;
public PersonBean() {
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
// getter/setter for firstName
public boolean isValid() {
return valid;
}
}
Demo Time…
9
Exception Handling
10
What is Exception
Handling?
• A more robust method for handling errors
than fastidiously checking for error codes
• error code checking is tedious and can obscure
program logic
11
Exception Handling (1)
• Throw Expression:
• raises the exception
• Try Block:
• contains a throw expression or a method that
throws an exception
12
Exception Handling (2)
• Catch Clause(s):
• handles the exception
• defined immediately after the try block
• Finally Clause:
• always gets called regardless of where exception
is caught
• sets something back to its original state
13
Java Exception Model
(1)
• Checked Exceptions
• enforced by the compiler
• Unchecked Exceptions
• recommended, but not enforced by the compiler
14
Java Exception Model
(2)
• Exception Specification
• specify what type of exception(s) a method will
throw
• Termination vs. Resumption semantics
15
16
// ExceptionDemo class
public class ExceptionDemo {
public static void main(String[] args) {
try {
initialize();
}
catch(Exception exception) {
exception.printStackTrace();
}
public void initialize() throws Exception {
// contains code that may throw an exception of type Exception
}
}
Demo Time…
17
Generics
18
What are Generics?
• A mechanism to ensure type safety in Java
collections
• introduced in Java 5
• Similar concept to C++ Template
mechanism
19
Generics (1)
• Prototype:
• visibilityModifier class |
interface name<Type> {}
20
21
// Iterator demo *without* Generics...
List list = new ArrayList();
for(int i = 0;i < 10;++i) {
list.add(new Integer(i));
}
Iterator iterator = list.iterator();
while(iterator.hasNext()) {
System.out.println(“i = ” + (Integer)iterator.next());
}
22
// Iterator demo *with* Generics...
List<Integer> list = new ArrayList<Integer>();
for(int i = 0;i < 10;++i) {
list.add(new Integer(i));
}
Iterator<Integer> iterator = list.iterator();
while(iterator.hasNext()) {
System.out.println(“i = ” + iterator.next());
}
23
// Defining Simple Generics
public interface List<E> {
add(E x);
}
public interface Iterator<E> {
E next();
boolean hasNext();
}
Java Database
Connectivity (JDBC)
24
What is JDBC?
• A built-in API to access data sources
• relational databases
• spreadsheets
• flat files
• The JDK includes a JDBC-ODBC bridge for
use with ODBC data sources
• type 1 driver
25
Java Database
Connectivity (1)
• Install database driver and/or ODBC driver
• Establish a connection to the database:
• Class.forName(driverName);
• Connection connection =
DriverManager.getConnection();
26
Java Database
Connectivity (2)
• Create JDBC statement:
•Statement statement =
connection.createStatement();
• Obtain result set:
• Result result =
statement.execute();
• Result result =
statement.executeQuery();
27
28
// JDBC example
import java.sql.*;
public class DatabaseDemo {
public static void main(String[] args) {
String sql = “SELECT * FROM timeZones”;
Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
Connection connection =
DriverManager.getConnection(“jdbc:odbc:timezones”,””,””);
Statement statement = connection.createStatement();
ResultSet result = statement.executeQuery(sql);
while(result.next()) {
System.out.println(result.getDouble(2) + “ “
+ result.getDouble(3));
}
connection.close();
}
}
Java Collections
Framework
29
What are Java
Collections? (1)
• A single object that groups together
multiple elements
• Collections are used to:
• store
• retrieve
• manipulate
30
What is the Java
Collection Framework?
• A unified architecture for collections
• All collection frameworks contain:
• interfaces
• implementations
• algorithms
• Inspired by the C++ Standard Template
Library
31
What is a Collection?
• A single object that groups together
multiple elements
• sometimes referred to as a container
• Containers before Java 2 were a
disappointment:
• only four containers
• no built-in algorithms
32
Collections (1)
• Implement the Collection interface
• Built-in implementations:
• List
• Set
33
Collections (2)
• Lists
• ordered sequences that support direct
indexing and bi-directional traversal
• Sets
• an unordered receptacle for elements
that conform to the notion of
mathematical set
34
35
// the Collection interface
public interface Collection<E> extends Iterable<E>{
boolean add(E e);
boolean addAll(Collection<? extends E> collection);
void clear();
boolean contains(Object object);
boolean containsAll(Collection<?> collection);
boolean equals(Object object);
int hashCode();
boolean isEmpty();
Iterator<E> iterator();
boolean remove(Object object);
boolean removeAll(Collection<?> collection);
boolean retainAll(Collection<?> collection);
int size();
Object[] toArray();
<T> T[] toArray(T[] array);
}
Iterators
• Used to access elements within an ordered
sequence
• All collections support iterators
• Traversal depends on the collection
• All iterators are fail-fast
• if the collection is changed by something other
than the iterator, the iterator becomes invalid
36
37
// Iterator demo
import java.util.*;
List<Integer> list = new ArrayList<Integer>();
for(int i = 0;i < 9;++i) {
list.add(new Integer(i));
}
Iterator iterator = list.iterator();
while(iterator.hasNext()) {
System.out.println(iterator.next());
}
0 1 2 3 4 5 6 7 8
current last
Demo Time…
38
Java IDEs (1)
• IntelliJ IDEA 2017.3
•jetbrains.com/idea
• stay tuned for version 2018.1 coming soon
• Eclipse IDE
•eclipse.org/ide
39
Java IDEs (2)
• NetBeans 8.2
•netbeans.org
• currently being moved from Oracle to Apache
40
Local Java User Groups
(1)
• ACGNJ Java Users Group
• facilitated by Mike Redlich
• javasig.org
• Princeton Java Users Group
• facilitated byYakov Fain
• meetup.com/NJFlex
41
Local Java User Groups
(2)
• NYJavaSIG
• facilitated by Frank Greco
• javasig.com
• PhillyJUG
• facilitated by Martin Snyder, et. al.
• meetup.com/PhillyJUG
42
Local Java User Groups
(3)
• Capital District Java Developers Network
• facilitated by Dan Patsey
•cdjdn.com
• currently restructuring
43
Further Reading
44
Upcoming Events
• ACGNJ Java Users Group
• Dr. Venkat Subramaniam
• Monday, March 19, 2018
• DorothyYoung Center for the Arts, Room 106
• Drew University
• 7:30-9:00pm
• “Twelve Ways to Make Code Suck Less”
45
46
Thanks!
mike@redlich.net
@mpredli
redlich.net
slideshare.net/mpredli01
github.com/mpredli01
Upcoming Events
• March 17-18, 2017
•tcf-nj.org
• April 18-19, 2017
•phillyemergingtech.com
47

More Related Content

What's hot (20)

PPT
core java
Vinodh Kumar
 
PPTX
Code generation for alternative languages
Rafael Winterhalter
 
ZIP
Elementary Sort
Sri Prasanna
 
PPTX
Understanding Java byte code and the class file format
Rafael Winterhalter
 
PPT
GateIn Frameworks
jviet
 
PDF
Native code in Android applications
Dmitry Matyukhin
 
PPT
Initial Java Core Concept
Rays Technologies
 
PPTX
An introduction to JVM performance
Rafael Winterhalter
 
PDF
Java 7 New Features
Jussi Pohjolainen
 
PPTX
Java 8 and beyond, a scala story
ittaiz
 
PDF
ERRest and Dojo
WO Community
 
PPTX
A topology of memory leaks on the JVM
Rafael Winterhalter
 
PPTX
Java and XML Schema
Raji Ghawi
 
PDF
Object Oriented Exploitation: New techniques in Windows mitigation bypass
Sam Thomas
 
PPTX
Java byte code in practice
Rafael Winterhalter
 
PDF
Java Concurrency by Example
Ganesh Samarthyam
 
PDF
4 gouping object
Robbie AkaChopa
 
PDF
Java OOP Programming language (Part 8) - Java Database JDBC
OUM SAOKOSAL
 
PPT
Android JNI
Siva Ramakrishna kv
 
core java
Vinodh Kumar
 
Code generation for alternative languages
Rafael Winterhalter
 
Elementary Sort
Sri Prasanna
 
Understanding Java byte code and the class file format
Rafael Winterhalter
 
GateIn Frameworks
jviet
 
Native code in Android applications
Dmitry Matyukhin
 
Initial Java Core Concept
Rays Technologies
 
An introduction to JVM performance
Rafael Winterhalter
 
Java 7 New Features
Jussi Pohjolainen
 
Java 8 and beyond, a scala story
ittaiz
 
ERRest and Dojo
WO Community
 
A topology of memory leaks on the JVM
Rafael Winterhalter
 
Java and XML Schema
Raji Ghawi
 
Object Oriented Exploitation: New techniques in Windows mitigation bypass
Sam Thomas
 
Java byte code in practice
Rafael Winterhalter
 
Java Concurrency by Example
Ganesh Samarthyam
 
4 gouping object
Robbie AkaChopa
 
Java OOP Programming language (Part 8) - Java Database JDBC
OUM SAOKOSAL
 
Android JNI
Siva Ramakrishna kv
 

Similar to Java Advanced Features (20)

PDF
Java Advanced Features (TCF 2014)
Michael Redlich
 
PPTX
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Olena Syrota
 
PPT
Java user group 2015 02-09-java8
Marc Tritschler
 
PPT
Java user group 2015 02-09-java8
marctritschler
 
PPTX
Java/Servlet/JSP/JDBC
FAKHRUN NISHA
 
PDF
JAVA Training in Bangalore
RIA Institute of technology
 
PPTX
More topics on Java
Ahmed Misbah
 
PDF
Java quickref
Arduino Aficionado
 
PDF
Core java 5 days workshop stuff
Rajiv Gupta
 
PPTX
Collections Training
Ramindu Deshapriya
 
PPTX
Core java introduction
Beenu Gautam
 
PDF
Java 5 and 6 New Features
Jussi Pohjolainen
 
PPT
What is Java Technology (An introduction with comparision of .net coding)
Shaharyar khan
 
PPTX
Java Jive 002.pptx
AdarshSingh202130
 
PDF
core java
dssreenath
 
PDF
What`s new in Java 7
Georgian Micsa
 
PPT
java collections
javeed_mhd
 
PPTX
Java For beginners and CSIT and IT students
Partnered Health
 
PPTX
Java SE 8 - New Features
Naveen Hegde
 
PPT
Core java by a introduction sandesh sharma
Sandesh Sharma
 
Java Advanced Features (TCF 2014)
Michael Redlich
 
Java World, Java Trends, Java 8 and Beyond (iForum - 2014)
Olena Syrota
 
Java user group 2015 02-09-java8
Marc Tritschler
 
Java user group 2015 02-09-java8
marctritschler
 
Java/Servlet/JSP/JDBC
FAKHRUN NISHA
 
JAVA Training in Bangalore
RIA Institute of technology
 
More topics on Java
Ahmed Misbah
 
Java quickref
Arduino Aficionado
 
Core java 5 days workshop stuff
Rajiv Gupta
 
Collections Training
Ramindu Deshapriya
 
Core java introduction
Beenu Gautam
 
Java 5 and 6 New Features
Jussi Pohjolainen
 
What is Java Technology (An introduction with comparision of .net coding)
Shaharyar khan
 
Java Jive 002.pptx
AdarshSingh202130
 
core java
dssreenath
 
What`s new in Java 7
Georgian Micsa
 
java collections
javeed_mhd
 
Java For beginners and CSIT and IT students
Partnered Health
 
Java SE 8 - New Features
Naveen Hegde
 
Core java by a introduction sandesh sharma
Sandesh Sharma
 
Ad

More from Michael Redlich (19)

PDF
Getting Started with GitHub
Michael Redlich
 
PDF
Building Microservices with Micronaut: A Full-Stack JVM-Based Framework
Michael Redlich
 
PDF
Building Microservices with Helidon: Oracle's New Java Microservices Framework
Michael Redlich
 
PDF
Introduction to Object Oriented Programming & Design Principles
Michael Redlich
 
PDF
Getting Started with C++
Michael Redlich
 
PDF
Introduction to Object Oriented Programming &amp; Design Principles
Michael Redlich
 
PDF
Getting Started with Java
Michael Redlich
 
PDF
Getting started with C++
Michael Redlich
 
PDF
Building Realtime Access to Data Apps with jOOQ
Michael Redlich
 
PDF
Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)
Michael Redlich
 
PDF
Building Realtime Web Apps with Angular and Meteor
Michael Redlich
 
PDF
Introduction to Object-Oriented Programming & Design Principles (TCF 2014)
Michael Redlich
 
PDF
Getting Started with Meteor (TCF ITPC 2014)
Michael Redlich
 
PDF
Getting Started with Java (TCF 2014)
Michael Redlich
 
PDF
Getting Started with C++ (TCF 2014)
Michael Redlich
 
PDF
C++ Advanced Features (TCF 2014)
Michael Redlich
 
PDF
Getting Started with MongoDB (TCF ITPC 2014)
Michael Redlich
 
PDF
Getting Started with MongoDB
Michael Redlich
 
PDF
Getting Started with Meteor
Michael Redlich
 
Getting Started with GitHub
Michael Redlich
 
Building Microservices with Micronaut: A Full-Stack JVM-Based Framework
Michael Redlich
 
Building Microservices with Helidon: Oracle's New Java Microservices Framework
Michael Redlich
 
Introduction to Object Oriented Programming & Design Principles
Michael Redlich
 
Getting Started with C++
Michael Redlich
 
Introduction to Object Oriented Programming &amp; Design Principles
Michael Redlich
 
Getting Started with Java
Michael Redlich
 
Getting started with C++
Michael Redlich
 
Building Realtime Access to Data Apps with jOOQ
Michael Redlich
 
Building Realtime Access Data Apps with Speedment (TCF ITPC 2017)
Michael Redlich
 
Building Realtime Web Apps with Angular and Meteor
Michael Redlich
 
Introduction to Object-Oriented Programming & Design Principles (TCF 2014)
Michael Redlich
 
Getting Started with Meteor (TCF ITPC 2014)
Michael Redlich
 
Getting Started with Java (TCF 2014)
Michael Redlich
 
Getting Started with C++ (TCF 2014)
Michael Redlich
 
C++ Advanced Features (TCF 2014)
Michael Redlich
 
Getting Started with MongoDB (TCF ITPC 2014)
Michael Redlich
 
Getting Started with MongoDB
Michael Redlich
 
Getting Started with Meteor
Michael Redlich
 
Ad

Recently uploaded (20)

PDF
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
PPTX
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Best Web development company in india 2025
Greenusys
 
PDF
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Best Web development company in india 2025
Greenusys
 
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 

Java Advanced Features

  • 1. 1 Java Advanced Features Trenton Computer Festival March 17, 2018 Michael P. Redlich @mpredli about.me/mpredli/
  • 2. Who’s Mike? • BS in CS from • “Petrochemical Research Organization” • Java Queue News Editor, InfoQ • Ai-Logix, Inc. (now AudioCodes) • Amateur Computer Group of New Jersey 2
  • 3. Objectives (1) • Java Beans • Exception Handling • Generics • Java Database Connectivity • Java Collections Framework 3
  • 5. What are Java Beans? • A method for developing reusable Java components • Also known as POJOs (Plain Old Java Objects) • Easily store and retrieve information 5
  • 6. Java Beans (1) • A Java class is considered a bean when it: • implements interface Serializable • defines a default constructor • defines properly named getter/setter methods 6
  • 7. Java Beans (2) • Getter/Setter methods: • return (get) and assign (set) a bean’s data members • Specified naming convention: •getMember •setMember •isValid 7
  • 8. 8 // PersonBean class (partial listing) public class PersonBean implements Serializable { private static final long serialVersionUID = 7526472295622776147L; private String lastName; private String firstName; private boolean valid; public PersonBean() { } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } // getter/setter for firstName public boolean isValid() { return valid; } }
  • 11. What is Exception Handling? • A more robust method for handling errors than fastidiously checking for error codes • error code checking is tedious and can obscure program logic 11
  • 12. Exception Handling (1) • Throw Expression: • raises the exception • Try Block: • contains a throw expression or a method that throws an exception 12
  • 13. Exception Handling (2) • Catch Clause(s): • handles the exception • defined immediately after the try block • Finally Clause: • always gets called regardless of where exception is caught • sets something back to its original state 13
  • 14. Java Exception Model (1) • Checked Exceptions • enforced by the compiler • Unchecked Exceptions • recommended, but not enforced by the compiler 14
  • 15. Java Exception Model (2) • Exception Specification • specify what type of exception(s) a method will throw • Termination vs. Resumption semantics 15
  • 16. 16 // ExceptionDemo class public class ExceptionDemo { public static void main(String[] args) { try { initialize(); } catch(Exception exception) { exception.printStackTrace(); } public void initialize() throws Exception { // contains code that may throw an exception of type Exception } }
  • 19. What are Generics? • A mechanism to ensure type safety in Java collections • introduced in Java 5 • Similar concept to C++ Template mechanism 19
  • 20. Generics (1) • Prototype: • visibilityModifier class | interface name<Type> {} 20
  • 21. 21 // Iterator demo *without* Generics... List list = new ArrayList(); for(int i = 0;i < 10;++i) { list.add(new Integer(i)); } Iterator iterator = list.iterator(); while(iterator.hasNext()) { System.out.println(“i = ” + (Integer)iterator.next()); }
  • 22. 22 // Iterator demo *with* Generics... List<Integer> list = new ArrayList<Integer>(); for(int i = 0;i < 10;++i) { list.add(new Integer(i)); } Iterator<Integer> iterator = list.iterator(); while(iterator.hasNext()) { System.out.println(“i = ” + iterator.next()); }
  • 23. 23 // Defining Simple Generics public interface List<E> { add(E x); } public interface Iterator<E> { E next(); boolean hasNext(); }
  • 25. What is JDBC? • A built-in API to access data sources • relational databases • spreadsheets • flat files • The JDK includes a JDBC-ODBC bridge for use with ODBC data sources • type 1 driver 25
  • 26. Java Database Connectivity (1) • Install database driver and/or ODBC driver • Establish a connection to the database: • Class.forName(driverName); • Connection connection = DriverManager.getConnection(); 26
  • 27. Java Database Connectivity (2) • Create JDBC statement: •Statement statement = connection.createStatement(); • Obtain result set: • Result result = statement.execute(); • Result result = statement.executeQuery(); 27
  • 28. 28 // JDBC example import java.sql.*; public class DatabaseDemo { public static void main(String[] args) { String sql = “SELECT * FROM timeZones”; Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”); Connection connection = DriverManager.getConnection(“jdbc:odbc:timezones”,””,””); Statement statement = connection.createStatement(); ResultSet result = statement.executeQuery(sql); while(result.next()) { System.out.println(result.getDouble(2) + “ “ + result.getDouble(3)); } connection.close(); } }
  • 30. What are Java Collections? (1) • A single object that groups together multiple elements • Collections are used to: • store • retrieve • manipulate 30
  • 31. What is the Java Collection Framework? • A unified architecture for collections • All collection frameworks contain: • interfaces • implementations • algorithms • Inspired by the C++ Standard Template Library 31
  • 32. What is a Collection? • A single object that groups together multiple elements • sometimes referred to as a container • Containers before Java 2 were a disappointment: • only four containers • no built-in algorithms 32
  • 33. Collections (1) • Implement the Collection interface • Built-in implementations: • List • Set 33
  • 34. Collections (2) • Lists • ordered sequences that support direct indexing and bi-directional traversal • Sets • an unordered receptacle for elements that conform to the notion of mathematical set 34
  • 35. 35 // the Collection interface public interface Collection<E> extends Iterable<E>{ boolean add(E e); boolean addAll(Collection<? extends E> collection); void clear(); boolean contains(Object object); boolean containsAll(Collection<?> collection); boolean equals(Object object); int hashCode(); boolean isEmpty(); Iterator<E> iterator(); boolean remove(Object object); boolean removeAll(Collection<?> collection); boolean retainAll(Collection<?> collection); int size(); Object[] toArray(); <T> T[] toArray(T[] array); }
  • 36. Iterators • Used to access elements within an ordered sequence • All collections support iterators • Traversal depends on the collection • All iterators are fail-fast • if the collection is changed by something other than the iterator, the iterator becomes invalid 36
  • 37. 37 // Iterator demo import java.util.*; List<Integer> list = new ArrayList<Integer>(); for(int i = 0;i < 9;++i) { list.add(new Integer(i)); } Iterator iterator = list.iterator(); while(iterator.hasNext()) { System.out.println(iterator.next()); } 0 1 2 3 4 5 6 7 8 current last
  • 39. Java IDEs (1) • IntelliJ IDEA 2017.3 •jetbrains.com/idea • stay tuned for version 2018.1 coming soon • Eclipse IDE •eclipse.org/ide 39
  • 40. Java IDEs (2) • NetBeans 8.2 •netbeans.org • currently being moved from Oracle to Apache 40
  • 41. Local Java User Groups (1) • ACGNJ Java Users Group • facilitated by Mike Redlich • javasig.org • Princeton Java Users Group • facilitated byYakov Fain • meetup.com/NJFlex 41
  • 42. Local Java User Groups (2) • NYJavaSIG • facilitated by Frank Greco • javasig.com • PhillyJUG • facilitated by Martin Snyder, et. al. • meetup.com/PhillyJUG 42
  • 43. Local Java User Groups (3) • Capital District Java Developers Network • facilitated by Dan Patsey •cdjdn.com • currently restructuring 43
  • 45. Upcoming Events • ACGNJ Java Users Group • Dr. Venkat Subramaniam • Monday, March 19, 2018 • DorothyYoung Center for the Arts, Room 106 • Drew University • 7:30-9:00pm • “Twelve Ways to Make Code Suck Less” 45
  • 47. Upcoming Events • March 17-18, 2017 •tcf-nj.org • April 18-19, 2017 •phillyemergingtech.com 47