+ Reply to Thread
Results 1 to 4 of 4

Thread: Answers Wanted to these QUESTIONS ?

  1. #1
    Member
    Join Date
    Feb 2006
    Location
    India
    Posts
    48
    Rep Power
    9


    Q.)Why do you Canvas ?



    Q.) What are ClassLoaders?


    Q.) Can we implement an interface in a JSP? If yes how? and No then why not?


    Q.) What is the difference between superclass & subclass?



    Q.)Dear Friends, in this sentence "Abstract classes are those for which instances can’t be created",What is the meaning of instances ?











    Aparna."Always aim for the moon, Never mind if you fail, You will fall among the Stars”




  2. #2
    Junior Member
    Join Date
    Feb 2006
    Location
    Posts
    7
    Rep Power
    8
    Q.)Dear Friends, in this sentence "Abstract classes are those for which instances can’t be created",What is the meaning of instances ?


    I hope you are quite familiar with the object creation in Java.


    Lets take a class A,


    Class A{


    /*Constructor */


    A(){


    System.out.println("I am class A");}


    public static void main(String args[]){


    /* Lemme create my instance*/


    A myInstanceA = new A();


    }


    }


    myInstanceA is the instance of class A. If the class A abstract you can not apply the new on that. That means instance can not be created.


    Hope you it helps you.


    Lemme know if you need clarification


    Cheers


    arash

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Location
    Posts
    7
    Rep Power
    8


    Q.) What are ClassLoaders?


    http://www.javaworld.com/javaworld/j.../jw-10-indepth. html


    Go through above link to know about the class loaders


    Q.) What is the difference between superclass & subclass?


    Superclass and the subclassare the terms used in the inheritance. The parent class is called the superclass and the class wich extends the parent class is called the subclass.


    E.g : A extends B, here is A is super class and the B subclass.



  4. #4
    Moderator
    Join Date
    Feb 2006
    Posts
    1,411
    Rep Power
    24
    hello



    Q.)Why do you need Canvas ?





    A Canvas component represents a blank rectangular
    area of the screen onto which the application can draw or from
    which the application can trap input events from the user.




    An application must subclass the Canvas class in
    order to get useful functionality such as creating a custom
    component. The paint method must be overridden
    in order to perform custom graphics on the canvas.




    Q.) What are ClassLoaders?




    The
    class loader concept, one of the cornerstones of the Java virtual
    machine, describes the behavior of converting a named class into the
    bits responsible for implementing that class. Because class loaders
    exist, the Java run time does not need to know anything about files and
    file systems when running Java programs





    Classes are introduced into the Java environment when they are
    referenced by name in a class that is already running. There is a bit
    of magic that goes on to get the first class running (which is why you
    have to declare the main()
    method as static, taking a string array as an argument), but once that
    class is running, future attempts at loading classes are done by the
    class loader.




    At its simplest, a
    class loader creates a flat name space of class bodies that are
    referenced by a string name. The method definition is:











    Class r = loadClass(String className, boolean resolveIt);





    The variable className
    contains a string that is understood by the class loader and is used to
    uniquely identify a class implementation. The variable resolveIt
    is a flag to tell the class loader that classes referenced by this
    class name should be resolved (that is, any referenced class should be
    loaded as well).




    All Java virtual
    machines include one class loader that is embedded in the virtual
    machine. This embedded loader is called the primordial class loader. It
    is somewhat special because the virtual machine assumes that it has
    access to a repository of trusted classes which can be run by the VM without verification.




    The primordial class loader implements the default implementation of loadClass(). Thus, this code understands that the class name java.lang.Object is stored in a file with the prefix java/lang/Object.class
    somewhere in the class path. This code also implements both class path
    searching and looking into zip files for classes. The really cool thing
    about the way this is designed is that Java can change its class
    storage model simply by changing the set of functions that implements
    the class loader.




    Digging around in the
    guts of the Java virtual machine, you will discover that the primordial
    class loader is implemented primarily in the functions FindClassFromClass and ResolveClass.




    So when are classes loaded? There are exactly two cases: when the new bytecode is executed (for example, FooClass f = new FooClass();) and when the bytecodes make a static reference to a class (for example, System.out).




    Q.) Can we implement an interface in a JSP? If yes how? and No then why not?




    i think only a classor interface can
    implement an interface and should implements all the methods defined in
    that interface but incase of jsp the webcontainer is creating the
    instances and call the respective methodsthat is defined in that
    container.So we cant implement interfaces in jsp.





    Q.) What is the difference between superclass & subclass?



    Super class is the one which is inherited

    Sub class is the one whicch inherits




    class A-------------SUPERCLASS

    {




    ............




    }




    class B extends A ----------------- SUBCLASS




    {

    .......




    }






    Q.)Dear Friends, in this sentence "Abstract classes are those for which instances can’t be created",What is the meaning of instances ?
    objects are the instances of the class



    instances are nothing but the copy of data members or function which can be accessible for every call on the object








    http://livetolead.blogspot.com/
    all the best
    Arise Awake N Stop Not Until Ur Goal Is Reached!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Content Relevant URLs by vBSEO 3.5.1 PL1