Search Results

Search found 1 results on 1 pages for 'user1508419'.

Page 1/1 | 1 

  • avoid NullPointerException at the first cycle

    - by user1508419
    I have this piece of code: EventSnapshot snapshotEvent = new EventSnapshot(); EventSnapshot currentEvent = new EventSnapshot(); do { ... currentEvent.setContent(in_stats); ... if(!snapshotEvent.equals(currentEvent)) snapshotEvent.setContent(in_stats); } while(true); At the first cycle I get a NullPointerException because obviously the object snapshotEvent is empty. At the second cycle this doesn't happen.how can avoid this problem?

    Read the article

1