Simple Java questions

  1. Meaning - Abstract classes, abstract methods
  2. Difference - Java,C++
  3. Difference between == and equals method
  4. Explain Java security model
  5. Explain working of Java Virtual Machine (JVM)
  6. Difference: Java Beans, Servlets
  7. Difference: AWT, Swing
  8. Disadvantages of Java
  9. What is BYTE Code ?
  10. What gives java it’s “write once and run anywhere” nature?
  11. Does Java have “goto”?
  12. What is the meaning of “final” keyword?
  13. Can I create final executable from Java?
  14. Explain Garbage collection mechanism in Java
  15. Why Java is not 100% pure object oriented language?
  16. What are interfaces? or How to support multiple inhertance in Java?
  17. How to use C++ code in Java Program?
  18. Difference between “APPLET” and “APPLICATION”
This entry was posted in Java. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

67 Comments on Simple Java questions

  1. Shambhu Soman
    Posted 12/1/2006 at 2:39 am | Permalink

    My answer to Naresh Kumar Query is Java is 100% object oriented because Java supports od the features of OOAD (Object Oriented Analysis and Design). For primitive datatyes java has provided immutable wrapper classes to convert to objects. Moreover, any thing and everything in java is written inside a class.

    Now try to correlate with procedural languages..
    cool
    Shambhu

  2. Shambhu Soman
    Posted 12/1/2006 at 2:44 am | Permalink

    To Vinay’s Query

    Java implements inhertance using keywords “extends” and “implements”. “extends” for classes and “implements” for interfaces. Remember java does support multiple inheritance. So a class can only extends one class and implement many interfaces.

    Where as anonymous inner classes use the keyword “new” to extends a class or to implement an interface.

    Cool,
    Shambhu

  3. Shambhu Soman
    Posted 12/1/2006 at 2:56 am | Permalink

    To Venkat’s Query

    In general Java doesn’t support operator overloading. But the developers of Java has given some flexiblity.
    ie we get the benefits of operator overloading in java.

    for eg:

    byte b = 1;
    double d = 1.0′

    System.out.println(”1″ + 1); // 11
    System.out.println(1 + 1); // 2
    System.out.println(b + d); // 2.0

    Here the “+” operator dealing with different datatypes. Here we can say “+” operator is overloaded.
    In the last example, due to arithmetic promotion of operands, variable “b” of type byte is promoted to the type double. That’s why we get “2.0″ as result.

    But according to rules of Java, Java doesn’t support operator overloading. :)

    Cool,
    Shambhu

  4. VenkatReddy
    Posted 12/2/2006 at 10:45 pm | Permalink

    1.What is the Purpose of the XML…?
    2.And wht about the features of it….?
    3.What is parsing in XML…?
    Plz give some examples……
    Plz give me the reply as early as possible? It’s urgent

  5. rahmath
    Posted 12/15/2006 at 4:42 am | Permalink

    why java is not pure oop language?

    the reason are 1.primitive datatype
    2.not supporting entire inheritance
    concept

  6. Srikanth Prekki
    Posted 12/28/2006 at 4:59 am | Permalink

    Hi,
    I have read comments about why Multiple Inheritance is not part of Java, let me remind that actually MI is a concept devised in Object Oriented Analysis and Design and not with C++. C++ has only implemented OOAD principles. Infact you may take any other OO language like PERL (not scripting lang) or python, you can implement the same.
    Java chose not to implement due to confusion during usage. Nothing beyond it.

  7. Fatima
    Posted 9/29/2007 at 2:31 am | Permalink

    how to draw a program flowchart based on the following scenario:

    The program will prompt the user to enter his/her name and age and determine whether he/she is an adult or teenager. If he/she is below 21 years old, the user would be a teenager else he/she would be an adult. The user would be prompted after each person, if he/she wishes to enter another name. The program continues to run until the user enters “No” or “N”.

  8. zulquarnain
    Posted 9/30/2007 at 3:44 am | Permalink

    Give me answer hurry.

  9. srikanth
    Posted 10/3/2007 at 12:47 am | Permalink

    to sreekant’s

    static var: it holds the memory for once which is shared by all
    objects.

    static () :it allows to use static variables or class variables only
    it doesn’t allows 2 use instance variables or fields.
    static{}: it is a static block& will b executed for exactly for
    once in a class.these r executed at first in the class
    before anything.

    * it allows only static data

    * a class can contain any number of static blocks.

  10. Hari.Dasani
    Posted 6/13/2008 at 1:25 am | Permalink

    Class A
    {
    int a;
    a=10;
    }
    when compile this code leads to error. Can some one explain why?

  11. Hari.Dasani
    Posted 6/13/2008 at 1:27 am | Permalink

    How “typedef” functionality can be achived in Java.

  12. Ram
    Posted 7/17/2008 at 7:04 pm | Permalink

    Hi,
    Hari.Dasani, you are initializing outside of a subroutine in two lines, that usually raises an error. Try
    class A
    {
    int a = 10;
    }

    Usually you instantiate the variables in the constructor.

    Thanks
    Hope that helps

  13. sreenu
    Posted 1/7/2009 at 1:19 am | Permalink

    abstract class means ,use same class name to another classes will helpful abstract classes

  14. sreenu
    Posted 1/7/2009 at 1:25 am | Permalink

    difference between c++ and java is c++ is not pure object oriented programing language(oopl),but java is pure oopl.
    some basical differences are
    * c++ have pointers ,but java does not contain pointers
    *c++ supports multiple inhertaince,java cant support multiple inhertiance
    * to over come the problem of multiuple inhertaince,java introduce interfaces
    *c++ features are dynamic bynding, message passing,polymorphism,inheritance,templates
    *java features are threads,applets,servlets ,packkeges,awt tools

  15. sreenu
    Posted 1/7/2009 at 1:29 am | Permalink

    What gives java it’s “write once and run anywhere” nature?
    java is platform independent ,it can be run in any where ,ie,it can be run in any operating system.thats why java is very famous in now technologies

  16. sreenu
    Posted 1/7/2009 at 1:33 am | Permalink

    Does Java have “goto”?
    java does not support goto statement ,because goto sttement conatain lable up:, controller directly transfer to the up statement,it may face difficult in java

  17. sreenu
    Posted 1/7/2009 at 1:36 am | Permalink

    What is the meaning of “final” keyword?
    final is keyword in java ,it can be work as like as constructor .when object is invioked all methods at finally without invoke of this final ,it will automatically will executed.it can be mainly used for printing of some message at finaally

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*