Normal
Servus Landei,ich hätte ein Beispiel geben sollen[code=Java]class Abc { static int a; static { InputStream in = ... .... a = in.read() }}[/code]In Scala würde das bei mir so aussehen[code=Java]object Abc { var a // call static myStaticKonstr def myStaticKonstr = { .... }}[/code]Die Scala-Lösung gefällt sowie so besser. Ich wollte nur wissen, ob Object einen Konstruktor wie der in Java besitzt?
Servus Landei,
ich hätte ein Beispiel geben sollen
[code=Java]class Abc {
static int a;
static {
InputStream in = ...
....
a = in.read()
}
}[/code]
In Scala würde das bei mir so aussehen
[code=Java]object Abc {
var a
// call static
myStaticKonstr
def myStaticKonstr = {
Die Scala-Lösung gefällt sowie so besser. Ich wollte nur wissen, ob Object einen Konstruktor wie der in Java besitzt?