The Artima Developer Community
Sponsored Link

Java Buzz Forum
pre-super() ...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bernard Choi

Posts: 74
Nickname: bchoi
Registered: Jun, 2003

Bernard Choi is online
pre-super() ... Posted: Jan 20, 2005 12:41 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Bernard Choi.
Original Post: pre-super() ...
Feed Title: Bernard Choi
Feed URL: http://bchoi.livejournal.com/data/rss
Feed Description: Bernard Choi - LiveJournal.com
Latest Java Buzz Posts
Latest Java Buzz Posts by Bernard Choi
Latest Posts From Bernard Choi

Advertisement
http://www.fnogol.de/archives/2005/01/19/use-static-method-to-initialize-classes-before-super-class-constructor-is-called/

Read the above... thought of the following :

public class SpecialMessage2 extends Message {
  public static SpecialMessage2 newInstance(String name) {
    Calendar cal = Calendar.getInstance();
    cal.roll(Calendar.DAY_OF_YEAR, -1);
    String newName = MessageFormat.format(
      “Yesterday at {0,date}, the message {1} was created", new Object[]{cal, name});
    return new SpecialMessage2("At ” + newName);
  }
}

Read: pre-super() ...

Topic: Mac mini on my mind (and apparently a lot of other minds too) Previous Topic   Next Topic Topic: [DJUG] Testing and Handling Exceptions in the Web Tier

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use