constructor
Best practice to creating Objects in java
I\'m reading the Effective Java book by Joshua Bloch. In the first chapter, he says to use factories instead of constructors and lists the advantages and disadvantages of this approach. As far as I se[详细]
2023-04-13 06:53 分类:问答Holding out on object creation
Is there ever a case where holding the necessary data to create an object and only creating it when is absolutely necessary, is better/more efficient than holding the object itself?[详细]
2023-04-13 06:36 分类:问答Possible to access private constructor-scoped variables from a functions prototype?
Based on my understanding of javascript, prototype methods cannot access variables that are private to the scope of the constructor,[详细]
2023-04-13 04:58 分类:问答calling constructor of a class member in constructor
Can I call constructor of a member in my Class\'s constructor? let say If I have a member bar of class type foo in my class MClass. Can I call constr开发者_如何学Gouctor of bar in MClass\'s construct[详细]
2023-04-13 02:14 分类:问答Java: Using same instance of a class in various other classes
it might be stupid question, but I dont know the answer to it and I dont know where to search the answer, so it would be nice if someone could help me.[详细]
2023-04-13 01:26 分类:问答what's the point of java constructor?
So I\'m learning java. I\'m one month in and I just learned about constructors. But I don\'t see the whole purpose of creating one. Why and when would I ever want to开发者_开发知识库 use one? I get th[详细]
2023-04-13 00:56 分类:问答How to create record class with default constructor
structures got default constructors like if I do type tagONEDEV_FlowRec = struct ....... end I can do new DeviceModel.tagONEDEV_FlowRec() but it doesn\'t work with this :[详细]
2023-04-12 16:37 分类:问答In-explicit constructing in operator overloading?
Is it possible use in-explicit constructing with operators ? Just like in this example (which does of course not work):[详细]
2023-04-12 15:14 分类:问答can someone explain the last argument of this function for me?
it\'s a constructor for a hash, but i don\'t understand the last argument. what is it doing? std开发者_C百科::fill(hash_table_, hash_table_ + HASH_TABLE_SIZE, (node *)NULL)[详细]
2023-04-12 09:25 分类:问答No enclosing instance of type MySuperClass<B> is available due to some intermediate constructor
I was trying to use an inner class of the super type, which was using generics. And got that strange error above.[详细]
2023-04-12 06:34 分类:问答