Skip to main content

All Questions

Tagged with or
-5 votes
0 answers
79 views

We cannot instantiate an inner class within a static context of the outer class, but when we declare this inner class as package- private. we are able to access its constructor. But how ? what is the ...
Hüseyin Çataloğlu's user avatar
Advice
2 votes
4 replies
247 views

Any C++ class can be first forward declared, and defined only later in the program. Are function-local classes an exception from this rule? Please consider a simplified program: auto f() { struct ...
Fedor's user avatar
  • 24.7k
0 votes
1 answer
77 views

Can nested classes or anonymous classes extend a class or implement an interface in Java? If so, are there any limitations or things I should be aware of? I'm not very familiar with nested classes, ...
coder12's user avatar
0 votes
2 answers
58 views

Say, I have an abstract superclass and an abstract test class for testing subclasses. abstract class Superclass { } @RequiredArgsConstructor abstract class SuperclassTest<T extends Superclass> {...
Jin Kwon's user avatar
  • 22.4k
2 votes
1 answer
45 views

I find an "Argument type mismatch" error in multiply function and don't know how to fix it. The code is: abstract class Semigroup<T1> { abstract val one: SemigroupElement<T1> ...
zplot's user avatar
  • 35
1 vote
0 answers
69 views

suppose I have a template class template<typename T> struct Foo { struct Bar; }; specializing Foo<int>::Bar template<> struct Foo<int>::Bar { struct Private; // I ...
hczstev's user avatar
  • 93
-1 votes
2 answers
89 views

Java shouldn't allow static methods within an inner class and yet this code compiles and runs. How is this possible? class Test{ static int j=20; public void m1() { class Inner{ ...
abhay chanana's user avatar
0 votes
2 answers
180 views

I am very curious about this question. The Java Language Specification has told me part of the reason: In a class instance creation expression for a non-private inner member class, §15.9.2 specifies ...
user24723440's user avatar

15 30 50 per page
1
2 3 4 5
196