🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.java
1 messages
1 total messages Started by Artur Tyloch Mon, 06 Oct 1997 20:59
Dec. anonymous class
#1107
Author: Artur Tyloch
Date: Mon, 06 Oct 1997 20:59
52 lines
1854 bytes
Hi.
I declare anonymous class using expression:
new Base(arg, arg, ...)Block

simple example:

public class Test3
{	
	private int m_nNumber = 0;
	private Counter counter;
	public static void main(String args[])
	{
		Test3 test = new Test3(); 
		test.counter.set(test.m_nNumber = 10);
		test.counter.add();
		System.out.println("Counter = "+test.counter.get());
	}
	Test3()
	{
		this.counter = new Counter()
					{
						public void set(int i)
						{m_nNumber = i;	}
						public int get()
						{return m_nNumber;}
						public void add()
						{m_nNumber++;}
					};
	}
}

Can anybody give me a example of decelerating anonymous class
this way: 
obj.new Base(arg, arg, ...)Block

regards
Artur

P.S.
send me answer via e-mail too, mailto:arturt@priv.onet.pl

-- 
-----
class Artur extends Tyloch implements Poznanable{
   URL myHomepage =
      new URL("http://friko.onet.pl/po/arturt");
   String status = "Under Construction !!!";
}
// remove n0__spam_ from my email address
// (if you are using reply command)
// to get correct address: arturt@priv.onet.pl
-----
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads