Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
146 views

Got a parametrized constructor which accepts size_t variables, and therefore should be called when trying to create an object passing a size_t variable. Instead, compiler tries to call the ...
Dima Lisovenko's user avatar
2 votes
3 answers
457 views

In Spring boot if we are creating a POJO class and we end up creating only a parameterized constructor and not any default constructor then Java will throw errors, why does this happen if Java ...
Ananthu K Kumar's user avatar
0 votes
0 answers
78 views

This is a constructor of class MyString: MyString(const char* const& _str = nullptr); Inside it, we give const char * and then again const& and then _str, what does const& mean here?
Umair Ahmed's user avatar
1 vote
0 answers
76 views

I have a Spring Boot application where an interface has a constraint: @Constraint( validatedBy = { MyValidator.class }) public @interface MyInterface { ... } I'm using Togglz to ...
runnerpaul's user avatar
  • 7,564
4 votes
1 answer
164 views

I'm new to programming in Julia (I'm coming from Java) and some Julia concepts are still difficult to understand to me. What I intend is to replicate this Java code: public class Archive<T extends ...
Antonio's user avatar
  • 41
1 vote
0 answers
41 views

I have following class A Class A { public A(String param1, String param2) // body } public A(String param1, String param2, String param3) // body } } My proguard settings keep 'public ...
Galet's user avatar
  • 6,379
0 votes
2 answers
249 views

Im working on a project for class and we have to create a Triangle class that will hold the lengths of each side of the triangle. I created a default constructor that gives each side of the triangle a ...
Jay Khan's user avatar
-2 votes
1 answer
611 views

What other ways are there to initialize the class field "fieldList" based on a given List object? One way would be Parameterized constructor. class ObjectA { private List<String> ...
Mihai Socaciu's user avatar
-2 votes
2 answers
652 views

If final variable is initialized in parameterized constructor and data is assigned through constructor args then final value seems to be changing here for every object. public class Test { final int ...
keerthi margesan's user avatar
1 vote
0 answers
124 views

I am Using MVC6- WebApi Parameterized constructor not calling. I referenced Ninject the below reference. http://sudiptachaudhari.com/dependency-injection-aspnet-webapi/ WebApi Controller public ...
Sajith's user avatar
  • 856
1 vote
1 answer
60 views

trying to inherit array adapter class it gives me an error when not defining a constructor in subclass....why should I define a constructor public class WordAdapter extends ArrayAdapter<word> { ...
user avatar
1 vote
2 answers
4k views

I have following code: @pytest.fixture def mock_path_functions(mocker, file_exists=True, file_size=10): mock_obj = mock.Mock() mock_obj.st_size = file_size mocker.patch("os.path....
anish's user avatar
  • 1,033
-1 votes
1 answer
423 views

I am a newbie in java and was wondering "Why default constructor is not provided by compiler when class contains parametrized constructor defined by user?"
Shivangi Arora's user avatar
2 votes
2 answers
1k views

Hi this might be trivial but I am trying to understand the class instantiation using interface. So below is my code: public interface IRepository { string GetMemberDisplayName(); } public class ...
Naphstor's user avatar
  • 2,536
1 vote
1 answer
563 views

I'm using NUnit + Webdriver + C#. Setup class has next stucture: [TestFixture(typeof(InternetExplorerDriver))] [TestFixture(typeof(ChromeDriver))] public partial class SetupBase<TWebDriver> ...
Tetiana's user avatar
  • 11
4 votes
2 answers
10k views

I looked at the Optional class method orElseThrow out of curiosity and I got confused of its signature. I didn't understand why it has to be declared as it is. So, I did an experiment with a copy of ...
Georgi Georgiev's user avatar
7 votes
1 answer
155 views

There seems to be a problem in using the signature given to a role in the roles you want to mix-in. Minimal example: #!/usr/bin/env perl6 role by-n[$n=1] { method multiply(Str $str) { return $...
jjmerelo's user avatar
  • 23.6k
1 vote
2 answers
92 views

Just wondering if this is the right way to do it. I want to construct instances of my parametrized class where one of the instance variables is a generic type. The code below works but I get a lot of ...
bez's user avatar
  • 187
0 votes
1 answer
90 views

When I write a simple parametrised constructor program, it compiles and runs in the command line. However when it is executed within the Eclipse IDE, I received the following exception: Exception ...
user avatar
3 votes
1 answer
246 views

I'm trying to do the following type Foo{T} x::changeType(T) end where the function changeType changes the type parameter to some other type. It doesn't have to be a function, I'm happy using a ...
Set's user avatar
  • 944
0 votes
2 answers
3k views

I am trying to implement model structure like this: Generic (abstract) TplInsurance (extends Generic) TplInsuranceDoctor (nested class in TplInsurance extends TplInsurance) Unfortunatelly I am ...
masterdany88's user avatar
  • 5,369
3 votes
2 answers
305 views

I have searched for some time and I can't find a solution. It's probably a simple syntax issue that I can't figure out. I have a type: # type ('a, 'b) mytype = 'a * 'b;; And I want to create a ...
Vlad V's user avatar
  • 1,654
0 votes
1 answer
796 views

I am trying to do some "custom lightweight" JSF component binding. In my bean (controlling some JSF page) i'm declaring a HahsMap where keys ranging over my h:inputText ids (appearing in the page) map ...
MikaKensi's user avatar
1 vote
9 answers
12k views

Suppose, I have the following code class C { int i; String s; C(){ System.out.println("In main constructor"); // Other processing } C(int i){ this(i,"...
mtk's user avatar
  • 13.8k