Why JVM is called a machine??????

Hello All,
i want to know why JVM is called a machine.
does it have a memory or processor in it,thats why
or some other reason pls explain
-thanks in advance
upasna

to be exact a java virtual machine, think of it this way, currently right now your machine thinks in "native code" aka binary, this is a "hardware" version of all software on your machine, most software is in "binary" format, next you have the java virtual machine which thinks in "bytecode" format, the virtual machine does not have a "hardware" version built onto your PC, so Sun had to make their own "software" version that converts "bytecode" into binary, this is why it is called a virtual machine because it sits on all operating systems and does this conversion so since it is not hardware, aka a "real" chip that does this conversion, it is "virtual" or software...

Similar Messages

  • Why jvm maintains string pool only for string objects why not for other objects?

    why jvm maintains string pool only for string objects why not for other objects? why there is no pool for other objects? what is the specialty of string?

    rp0428 wrote:
    You might be aware of the fact that String is an immutable object, which means string object once created cannot be manipulated or modified. If we are going for such operation then we will be creating a new string out of that operation.
    It's a JVM design-time decision or rather better memory management. In programming it's quite a common case that we will define string with same values multiple times and having a pool to hold these data will be much efficient. Multiple references from program point/ refer to same object/ value.
    Please refer these links
    What is Java String Pool? | JournalDev
    Why String is Immutable in Java ? | Javalobby
    Sorry but you are spreading FALSE information. Also, that first article is WRONG - just as OP was wrong.
    This is NO SUCH THING as a 'string pool' in Java. There is a CONSTANT pool and that pool can include STRING CONSTANTS.
    It has NOTHING to do with immutability - it has to do with CONSTANTS.
    Just because a string is immutable does NOT mean it is a CONSTANT. And just because two strings have the exact same sequence of characters does NOT mean they use values from the constant pool.
    On the other hand class String offers the .intern() method to ensure that there is only one instance of class String for a certain sequence of characters, and the JVM calls it implicitly for literal strings and compile time string concatination results.
    Chapter 3. Lexical Structure
    In that sense the OPs question is valid, although the OP uses wrong wording.
    And the question is: what makes class Strings special so that it offers interning while other basic types don't.
    I don't know the answer.
    But in my opinion this is because of the hybrid nature of strings.
    In Java we have primitive types (int, float, double...) and Object types (Integer, Float, Double).
    The primitive types are consessons to C developers. Without primitive types you could not write simple equiations or comparisons (a = 2+3; if (a==5) ...). [autoboxing has not been there from the beginning...]
    The String class is different, almost something of both. You create String literals as you do with primitives (String a = "aString") and you can concatinate strings with the '+' operator. Nevertheless each string is an object.
    It should be common knowledge that strings should not be compared with '==' but because of the interning functionality this works surprisingly often.
    Since strings are so easy to create and each string is an object the lack ot the interning functionality would cause heavy memory consumption. Just look at your code how often you use the same string literal within your program.
    The memory problem is less important for other object types. Either because you create less equal objects of them or the benefit of pointing to the same object is less (eg. because the memory foot print of the individual objects is almost the same as the memory footpint of the references to it needed anyway).
    These are my personal thoughts.
    Hope this helps.
    bye
    TPD

  • Why cant I call a getResultSet method more than 1

    Why cant I call the getRSS method more than 1 time from my page?
    I have a class called methods class, here is the code:
    public class methodsClass {
        public java.sql.Connection objConn = null;
        public String query = null;
        public java.sql.PreparedStatement statement = null;
        public java.sql.ResultSet objRS = null;
        /** Creates a new instance of methodsClass */
        public methodsClass() {}
         public ResultSet getRSS(String sql)
            String strSQL = sql;
            try
                Class.forName("oracle.jdbc.driver.OracleDriver");
                objConn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:CCD","system", "Abcd1234");
                statement = objConn.prepareStatement(strSQL,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
                objRS = statement.executeQuery();
            catch (Exception e)
                System.err.println("Error in getRSS method");
                e.printStackTrace();
            return objRS;
        public void killConn()
            try
                    objRS.close();
                    System.out.println("Resultset is closed");
                    statement.close();
                    System.out.println("Statement is closed");
                    objConn.close();
                    System.out.println("Connection is closed");
                catch(Exception e)
                System.err.print("Unable to kill all objects");
                e.printStackTrace();
    //END OF CLASS***************************************** I call the method from the following jsp:
    <%
    String eqCat = "Tracked Vehicle";
    String strSQL = "SELECT DISTINCT * FROM robert WHERE eqcategory = '"+eqCat+"'";
    methodsClass mc = new methodsClass();
    ResultSet objRS = mc.getRSS(strSQL);
    java.lang.System.out.println(strSQL);
    %>
         <select name="selectBox">
         <% while(objRS.next()){
             out.println("<option value='"+objRS.getString("eqtype")+"'>"+objRS.getString("eqtype")+"</option>");
               mc.killConn();
    %> The above works fine.
    If I try to call the getRSS function again on this page I get the following error:javax.servlet.ServletException: Exhausted Resultset
    I tried to call it like so:
    newNameSQL = "Select * from robert where eqtypes = 'someVariable'";
    newNameRS = mc.getRSS(strSQL);
    <%=newNameRSS.getString("something");%>I cant understand why I get this error, I am closing the rs,conn and statement in the killConn method.
    TIA!

    I did that but still the same error. The problem is when I attempt to open up another resultset on the same page I get the Exhausted ResultSet error. I have even eliminated the class file altogether by doing this:
      String eqCat = "Tracked Vehicle";
      String strSQL = "SELECT DISTINCT eqtype FROM robert WHERE eqcategory = '"+eqCat+"'";
      Class.forName("oracle.jdbc.driver.OracleDriver");
      Connection objConn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:CCD","system", "Abcd1234");
      PreparedStatement statement = objConn.prepareStatement(strSQL,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
      ResultSet objRS = statement.executeQuery();
      System.out.println(strSQL);
    //The above works fine and then below I add this and the error comes back
         <select name="cs_popup_name_1" onchange="CSURLPopupShow(/*CMP*/'cs_form_name_1', /*CMP*/'cs_popup_name_1', 'Main');">
         <% while(objRS.next()){
            String eq = objRS.getString("eqtype");
             out.println("<option value='"+eq+"'>"+eq+"</option>");
    objRS.close();
    objConn.close();
    statement = null;
    strSQL = null;
    strSQL = "SELECT * FROM robert";
      Class.forName("oracle.jdbc.driver.OracleDriver");
      objConn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:CCD","system", "Abcd1234");
      statement = objConn.prepareStatement(strSQL,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
      ResultSet rs = statement.executeQuery();
      System.out.println(strSQL);
    //If I leave the field below commented out I get no errors, but if I comment it out I get the error
    <a href="#" onmouseover="showImg('<%=rs.getString("img1")%>')">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Bug in LP: smart call/answering machine 1.28

    Bug in smart call/ answering machine in Lp 1.28
    Smart call have 2 bugs and one suggestion.
    1. Sometimes smart call isnt work. After restart phone its works again. I test in some devices and all of them have this bug.
    2. While talking phone if someone is waiting on another call, after seprate phone from ear and see who is on another call. So after bring device to ear call accepted and old call end. This is so annoying.
    3. Seprate smart call options. I dont want answer my phone with bring device to ear but i need to reject and mute mode.. Plz
    And about answering machine.
    In lollipop answering machine have some problems.. For example sometimes i am taking with phone and answering machine starts automatically and call ended. Or sometimes calls dont go to answering machine.
    Some ui bugs: 
    3 dot icon is bigger in phone/contacts app vs other stock apps
    Small apps page isnt material yet
    Sorry for my bad english..my phone is z2 23,1.a.1.28

    Contact Sony Xperia Support with your bug report .
    http://support.sonymobile.com/global-en/contactUs/

  • Why java is called java2

    why java is called java2 and another thing that i would like to know is why it was renamed to java from its previous name OAK
    Thanx
    Manish

    why java is called java2Not to sure about this one, but I think it was a marketing decision - I guess 'Welcome to the Java 2 platform' sounds better than saying 'Welcome to the JDK 1.2.1 platform' :=)
    and another thing that i
    would like to know is why it was renamed to java from
    its previous name OAKThere was already a patented product named 'OAK', so they had to rename it to something else to avoid the law.
    >
    Thanx
    ManishA brief history of Java:
    http://java.sun.com/features/1998/05/birthday.html
    http://www.ils.unc.edu/blaze/java/javahist.html

  • Why JNDI is called an Interface?

    Why JNDI is called as Java Naming and Directory Interface, question is why
    interface ? when it is not a interface ?

    It is an interface because it is defined as an abstract set of APIs, not actually implementation. The actually implementation is done by service providers.
    Defining an abstract set of APIs without actually implementation can isolate the implemenation of service provide and client application code, thus make them more independently from each other. i.e, a client application would not need to know what changes made by any particular vendor.
    Hope this helps.

  • Why doesn't calls to my iPhone ring through to my Mac?

    Why doesn't calls to my iPhone ring through to my Mac?

    The following have the requirements and settings and some troubleshooting information:
    Connect your iPhone, iPad, iPod touch, and Mac using Continuity - Apple Support
    Get help using Continuity with iOS 8 and OS X Yosemite - Apple Support

  • HT1245 Why does my caller I.D. photos show as a small thumbnail in the upper right corner and not full screen? I have used both photos I have synced and photos I have taken, yet others have full screen photo I.D.'s.

    Why does my caller I.D. photos show as a small thumbnail in the upper right corner and not full screen? I have used both photos I have synced and photos I have taken, yet others have full screen photo I.D.'s. I have looked onlime at several threads and there are no real answers as to what I need to do or am doing wrong.

    I am also having this issue.
    I've just spoken to someone in the Apple Support Centre who advised me that since the product is in beta, he is unable to assist. I wanted to find out whether someone was able to delete the data for me, or 'reset' the photos app somehow. This apparently cannot be done. He suggested I provide feedback via the feedback page, which I will do, but to be honest doesn't fill me with a lot of confidence in the issue being fixed.
    I also deactivated the service and waited the 30 days for the pictures to be deleted - this should have been completed in mid-January. Instead, my iCloud.com Photos page is now showing the photos that should have been deleted as grey squares, just as you described. I am also unable to delete these photos; every time I try, I get the same message about a server error.
    I am also unable to disable the service by enabling and then disabling it on my iPhone. Each time I have tried this it hangs on uploading for several hours, with the progress bar not moving at all. When I disable it on my iPhone, the web app remains unchanged.
    If anyone has had this issue and has managed to fix it, PLEASE share your wisdom. I am out of patience!

  • Why do we call Enterprise Manger 10.2.0.3 "EM 10g R3" ?

    Why do we call Enterprise Manger 10.2.0.3 "EM 10g R3" ?
    I think it is ok "EM 10g R2" is Enterprise Manager 10.2.0.x. and
    "EM 10g R3" is Enterprise Manager 10.3.0.x.
    Your opinion?

    If it is a mistake/typo, then it will be Oracle's fault.
    There was Enterprise Manager 10g Grid Control Release 2 (v10.2.x). Which to me is 10g R2
    Now they are referring EMGC 10.2.0.3 as Enterprise Manager 10g Grid Control Release 3 (10.2.0.3). So that to me is 10g R3 because of the Release 3.
    If you remember, there were Oracle products named Oracle xxx 10g Release x(9.x.x). So, I think we are seing the same here.
    So, do not be surprised if you see 11g Release 1 (10.2.x.x).

  • Why JVM treats every thing as a String only

    Hi
    If i am passing any input i.e primitive values from command prompt, I want to convert it once again back to primitives by using Integer.parseInt().
    Why JVM is treating everything as a String only. why can't it read as primitives itself ?
    Any reason behind that ?

    It's not the JVM, it's the operating system, in fact all operating systems I've ever worked with (and there've been quite a few).
    You type a string on the commandline, the operating system couldn't care less what data is in that string.
    It only takes the parts it needs to determine what the actual program to start or command to run is, and passes the entire string to that.
    The command or program then can do whatever it wants with that string.
    The JVM works in the same way. It parses the string to figure out what its classpath is and what class to launch, and passes everything else on to that class (it is nice enough to turn it into an array for you).
    It can't know if when you type a number it's supposed to be a number or not. It can't know whether a letter you typed was actually supposed to have been a number but was a typo, or maybe it is a number in some other numbering system (think hexadecimal).

  • Why do we call an ABAP Runtime error a "Short Dump"

    Hi All,
    I was just working on one of the ABAP runtime errors with my technical counterpart and a question came to my mind "Why do we call an ABAP Runtime error a "Short Dump"?".
    I tried asking a few friends of mine working in the technical space in SAP and they were not able to answer.
    So, some one of you experts help me getting answer to this question.
    Thanks in Advance.
    Nitin.

    ABAP Runtime error is a generalized term .......... meaning the error occured while runtime.
    wheare as short dump.
    Short -  means brief.
    dump - error information from the memory
    Short dumps (also called ABAP memory dumps). Short dumps occur when an ABAP program fails.
    Short dumps provide basic information about which program failed and what the error was.
    hope this helps.

  • Why ProfileAdapterRepository is called so? where is the Adapter in it?

    Does anyone know why ProfileAdapterRepository is called so. You won't see the word Adapter in any other repository name. Do we have an implementation of adapter pattern in ProfileRepository?
    /atg/commerce/claimable/ClaimableRepository
    /atg/commerce/inventory/InventoryRepository
    /atg/commerce/invoice/InvoiceRepository
    /atg/commerce/order/OrderRepository
    /atg/commerce/order/processor/AddOrderToRepository
    /atg/content/media/MediaRepository
    /atg/dynamo/security/AdminSqlRepository
    /atg/dynamo/service/jdbc/SDSRepository
    /atg/dynamo/service/jdbc/SQLRepository
    /atg/dynamo/templates/HTMLRepository
    /atg/dynamo/templates/XMLRepository
    /atg/multisite/SiteRepository
    /atg/sitemap/SitemapRepository
    /atg/userprofiling/PersonalizationRepository
    /atg/userprofiling/Profile*Adapter*Repository

    Sanju,
    in ATG, you can maintain separate profile repositories for external and internal users. There are separate repository definition files for internal users and external users. The external profiles are stored in the /atg/userprofiling/ProfileAdapterRepository, defined by the userProfile.xml file located in <ATG10dir>\DPS\config\profile.jar. Internal profiles are stored in the /atg/userprofiling/InternalProfileRepository, defined by the internalUserProfile.xml file in <ATG10dir>\DPS\InternalUsers\config\config.jar.
    Other repositories will not be having different categories within them. for example for inventory we do not have sub types and hence the generic term InventoryRepository. In case of profile to identify whether it is an external profile repository or internal profile repository we have additional attribute attached to the name of the repository.
    Also since Repository concept is basically built on Adapter design pattern we see this Adapter in ProfileAdapterRepository instead of something like ExternalProfileRepository

  • Why are regional calls not in Five Cents plan, but instead are 21 cents/min.?

    Why are "regional calls" not included in Five Cents/minute calling plan, but instead billed at 21 cents/minute !??!
    "Local" calls are 9 cents/Call, everywhere else in the U.S. It is 5 cents/minute on the plan.  So regional calls are much more expensive than calls to Hawaii!!
    Also how do I find what is the "regional" area (for Manhattan, New York City), and what is the "local" area?  Is there a link  somewhere on the Verizon site to enable finding your own regional area versus local or long distance?

    Sorry you are having difficulty, an agent with access to your account will reach out to you directly by email, private message in the Forums and/or the billing telephone number on your Verizon account for more information to help you resolve your issue.Please remember to check your spam/junk folder if you do not hear from an agent.

  • I am trying to install CS 5.5 master and I have mac 10.7. Why does it say my machine doesn't meet mi

    I am trying to install CS 5.5 master and I have mac 10.7. Why does it say my machine doesn't meet minimum requirements?

    What processor are you using?  Which Mac are you installing this on?  How much memory do you have installed? You can find the system requirements listed at http://helpx.adobe.com/x-productkb/policy-pricing/system-requirements-master-collection.ht ml#main_CS5_Master_Collection_system_requirements.  You will want to make sure that you meet or exceed each of these requirements.

  • Why is the call history time on the printout different than the phone?

    Why is the call history time on the printout different than the phone?

    How much different is it? A minute or two??
    Calls are triggered the minute you hit send, not answered. And the same when ending a call. So if off a minute or two for a call that is why.

Maybe you are looking for