Java

Topic: Class

Explain public static Object instantiate(ClassLoader cls,                 String beanName,                 BeanContext beanContext,                 AppletInitializer initializer)                          throws IOException,                                 ClassNotFoundException?

Instantiate a bean.The bean is created based on a name relative to a class-loader. This name should be a dot-separated name such as "a.b.c".In Beans 1.0 the given name can indicate either a serialized object or a class. Other mechanisms may be added in the future. In beans 1.0 we first try to treat the beanName as a serialized object name then as a class name.When using the beanName as a serialized object name we convert the given beanName to a resource pathname and add a trailing ".ser" suffix. We then try to load a serialized object from that resource.For example, given a beanName of "x.y", Beans.instantiate would first try to read a serialized object from the resource "x/y.ser" and if that failed it would try to load the class "x.y" and create an instance of that class.If the bean is a subtype of java.applet.Applet, then it is given some special initialization. First, it is supplied with a default AppletStub and AppletContext. Second, if it was instantiated from a classname the applet's "init" method is called. (If the bean was deserialized this step is skipped.)Note that for beans which are applets, it is the caller's responsiblity to call "start" on the applet. For correct behaviour, this should be done after the applet has been added into a visible AWT container.Note that applets created via beans.instantiate run in a slightly different environment than applets running inside browsers. In particular, bean applets have no access to "parameters", so they may wish to provide property get/set methods to set parameter values. We advise bean-applet developers to test their bean-applets against both the JDK appletviewer (for a reference browser environment) and the BDK BeanBox (for a reference bean container).

Browse random answers:

What is a class?
What is an immutable class?
Immutable objects are automatically thread-safe –true/false?
Which classes in java are immutable?
What are the advantages of immutability?
Use the following syntax to declare a class in Java:
What are the methods in Object?
What is singleton?
What is Class.forName() does and how it is useful?
What is the Locale class? 
Can we declare the main method of our class as private?
How an object is serialized in java?
Can a class have multiple constructors?
Can a class be a super class and a sub-class at the same time
How objects of a class are created if no constructor is defined in the class?
What is the purpose of Void class?
Write simple example of class?
What is inner class? 
What is nested class?
There are two classes named classA and classB. Both classes are in the same package. Can a private member of classA can be accessed by an object of classB?
 A person says that he compiled a java class successfully without even having a main method in it? Is it possible?
Is it possible to define a method in Java class but provide it’s implementation in the code of another language like C?
Explain Interface ActiveEvent?
Explain Class PopupFactory in java?
Explain Class ProgressMonitor in java ?
Explain Class ProgressMonitor.AccessibleProgressMonitor in java?
Explain Class ProgressMonitorInputStream in java ?
Explain Class RepaintManager in java?
Explain Interface RootPaneContainer in java?
Explain Class RowSorter.SortKey in java ?
Explain Interface ScrollPaneConstants in java?
Explain Class SortingFocusTraversalPolicy?
Explain Enum SortOrder in java ?
Explain Class Spring in java?
Explain Class SpringLayout in java?
Explain Class Timer in java?
Explain public BeanDescriptor(Class<?> beanClass)?
Explain public BeanDescriptor(Class<?> beanClass,              Class<?> customizerClass)
Explain method getBeanClasspublic Class<?> getBeanClass()?
Explain method getCustomizerClasspublic Class<?> getCustomizerClass()?
Explain public static Object instantiate(ClassLoader cls,                 String beanName)                          throws IOException,                                 ClassNotFoundException
Explain public static Object instantiate(ClassLoader cls,                 String beanName,                 BeanContext beanContext)                          throws IOException,                                 ClassNotFoundException?
Explain public static Object instantiate(ClassLoader cls,                 String beanName,                 BeanContext beanContext,                 AppletInitializer initializer)                          throws IOException,                                 ClassNotFoundException?
Explain public static Object getInstanceOf(Object bean,                   Class<?> targetType)?
Explain method isInstanceOfpublic static boolean isInstanceOf(Object bean,                   Class<?> targetType)?
Explain method isDesignTimepublic static boolean isDesignTime()?
Explain public DefaultPersistenceDelegate(String[] constructorPropertyNames)
Explain Class SimpleBeanInfojava.lang.Object        java.beans.SimpleBeanInfo?