I would like to have a Method like:   loadAllClassesOfPackage("com.elementghost.projectname");  But my main will not be able to know the Classes that should be loaded. It will only know a package, and from this package, every classes constructor or static block (Both oportunities would be okay), should be loaded.  Is it possible to pass my Main a package, and then in every class in it, will be executed the constructor.
14648
Is it possible to find all classes or interfaces in a given package? (Quickly looking at e.g. , it would seem like no.)
5983
The title is kind of obscure. What I want to know is if this is possible:  string typeName = &lt;read type name from somwhere&gt;; Type myType = Type.GetType(typeName);  MyGenericClass&lt;myType&gt; myGenericClass = new MyGenericClass&lt;myType&gt;();   Obviously, MyGenericClass is described as:  public class MyGenericClass&lt;T&gt;   Right now, the compiler complains that 'The type or namespace 'myType' could not be found." There has got to be a way to do this.
8367
Is it possible to run some code when an assembly is loaded, without doing anything specific in the loading code? What I am looking for is like a static constructor on a type.  Eg:  Assembly A does not know about Assembly B, but B does know about A. Assembly A needs to know certain things about B if B is loaded. When Assembly B is loaded by the runtime (referenced, or explicit), I want a piece of code (static method or attribute) to be executed that calls a method in Assembly A.  The root cause of this problem is unknown types being encountered when serializing a type in A that contains types from B not known at compile time as interfaces are used.
2312
I want to downgrade some packages. I search and find  and this  and this .  But i just want to do it with dpkg.  Could i just run dpkg -i package-name? If yes then what will be done with the highest already insatlled version?!
77278
I am calling the method defined in a class implemented from another module using the following code.  use Drupal\module_name\MyClassName;  $instance = Drupal\module_name\MyClassName::getinstance($host, $user, $pass);   My code doesn't work, as I get an error about a class not found. What am I doing wrong?  The class is contained in module/src/controiller/controller_name.php.
22377
Some time ago, I came across a piece of code, that used some piece of standard Java functionality to locate the classes that implemented a given interface. I know the functions were hidden in some non-logical place, but they could be used for other classes as the package name implied. Back then I did not need it, so I forgot about it, but now I do, and I can't seem to find the functions again. Where can these functions be found?  Edit: I'm not looking for any IDE functions or anything, but rather something that can be executed within the Java application.
21406
I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the help function on each one. In Ruby I can do something like ClassName.methods to get a list of all the methods available on that class. Is there something similar in Python? eg. something like: from somemodule import foo print(foo.methods)  # or whatever is the correct method to call
2907
Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.  Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?
26254
The question is in Java why can't I define an abstract static method? for example  abstract class foo {     abstract void bar( ); // &lt;-- this is ok     abstract static void bar2(); //&lt;-- this isn't why? }
30990
In my view, any document with a substantial amount of mathematics should load the packages from AMS-TeX. Hence, most of my document's preambles contain  \usepackage{amsmath, amsthm, amssymb, amsfonts}   (I could add to that the non-AMS mathtools, etc.). What do each of those packages do? Do I really need to list all of them, or do some of them load others? In particular, does any package load all of them, so that I can simply type  \usepackage{ams-everything}   shorter than the current list?
109435
What is the syntax and which namespace/class needs to be imported? Give me sample code if possible. It would be of great help.
78759
Is it possible to load some package from a .sty file only if some option is selected?  (Naive approach \DeclareOption{something}{\RequirePackage{something}} doesn't work.)
16650
Can anyone think of any situation to use multiple inheritance? Every case I can think of can be solved by the method operator   AnotherClass() { return this-&gt;something.anotherClass; }
4123
I just ran across the following error (and found the solution online, but it's not present in Stack Overflow):     (.gnu.linkonce.[stuff]): undefined   reference to [method] [object   file]:(.gnu.linkonce.[stuff]):   undefined reference to `typeinfo for   [classname]'   Why might one get one of these "undefined reference to typeinfo" linker errors?  (Bonus points if you can explain what's going on behind the scenes.)
74151
I'm already familiar with the standard Java package naming convention of using a domain name to create a unique package name (i.e. package com.stackoverflow.widgets). However, I've never seen any recommendations for how to choose package names for personal projects. I assume because this is because this is really a matter of personal taste.  So, how do you choose package names for personal projects that will never make it into production (you might be experimenting with a new framework in your spare time). Assuming you don't have a personal website whose domain you can use to create your package structure, what do (or would) you do? Do you have a logical system in place for generating new package names for hobby projects, or do you just use simple throw-away package names like mypackage?  Since I'm just curious to see what different people's thoughts are on this, I've made this a community wiki.  For me personally, I've never given it much thought, but I wanted to play around with  tonight and it occurred to me that I don't have a clear idea of how I want to organize my hobby projects. A separate, distinct package naming convention for hobby projects (in my mind, at least) would serve as a good way to keep personal and work-related code clearly separate from each other.  I was thinking of a simple hierarchal naming convention, to keep the source for my personal projects in a single root folder:   Use myprojects as the root folder  Append the project name  Add any additional subpackage names   So, my Wicket project would be in the package myprojects.learningwicket and unit tests would be in the package myprojects.learningwicket.tests (for example).
37596
Say I have a class that's meant to perform a single function. After performing the function, it can be destroyed. Is there any reason to prefer one of these approaches?  // Initialize arguments in constructor MyClass myObject = new MyClass(arg1, arg2, arg3); myObject.myMethod();  // Pass arguments to method MyClass myObject = new MyClass(); myObject.myMethod(arg1, arg2, arg3);  // Pass arguments to static method MyClass.myMethod(arg1, arg2, arg3);   I was being intentionally vague about the details, to try to get guidelines for different situations. But I didn't really have in mind simple library functions like Math.random(). I'm thinking more of classes that perform some specific, complex task, but only require one (public) method to do it.
21168
If I have a Windows executable, how can I find out which dlls it will load?  I'm just talking about which ones that will be loaded statically, not ones it might load dynamically with something like LoadLibrary.