Java is inefficient right? The application that takes the longest to load on anyone's computer I've found is done in Java (Matlab, Eclipse, LotusNotes, are some examples).\n\nSo why is it inefficient? Is the inefficiency only at startup?\n\nIs it one language feature that's holding things up or is it a little bit of many things? To what extent do some of the following have an effect on computation time.\n\nPortability via the JVM\nJIT compiling\nHeap allocation of all classes\nVirtualness as the default for functions\nOthers?\n\nWhere all of the above differ from C++
200296
Java can be faster than C++. \n\nA JIT (Just in time) compiler must be used.  The reason Java programs start slowly is because they start out being interpreted (the bytecode to machine code) but at the same time the speed is being profiled (tested for bottlenecks and places to perform optimizations), the JIT compiler will use the bytecode and the information from the profiling process and generate machine code (run on the hardware) which results in very fast execution times...  THe price you pay is startup speed...\n\nAll of that being said: if a major goal of a program you are writing is speed then you should use C++ because then you, the programmer, have more direct control of how fast your program will run.
349697
Depends what configuration you have... If you're running on a lower performance computer and you have a lot of apps installed, it will take a while untill the list is filled (it could last a few minutes)...(On my old Duron 700Mhz with 256ram  i had oracle 9i installed and working:D, .NET 2001 and other programming stuff and it took me 5 minutes as I remember until that list was "filled"...).
158688
The number of installed programs does not affect the computer speed.\n\nInstead, the number of RUNNING applications is the one which affect the speed.\nTry to reduce the amount of running program and you will get peter performance.\n\n\nPS: Many programs install put a running files to run all the time, so be careful\n\nXLMan
444480
Before I offer an answer, I would like to make a couple of comments.\n\nFirst, seeing how you are using Java, I'm assuming this is an introductory programming course. One thing I HIGHLY recommend you do in the future is COMMENT, COMMENT, COMMENT! Get in the habit of doing it now. It didn't make a huge difference for this particular piece of code, but if you want others to help you debug your code, they need to be able to understand your code.\n\nSecond, I would like to make a remark about n2thepower's answer. I agree that Java will probably be dead a few years down the road, but the fact is that most languages will end up dying at some point or another. More than likely, the class teaches principles of object-oriented programming and not Java, per se. These you can take with you anywhere, no matter what particular programming language you end up using, but if you fail to master these fundamental underpinnings, good luck. The reason for Java's widespread use in beginning programming classes is its relative "friendliness" to budding programmers. (I've heard the analogy of C++ to Java as a scalpel to kiddy scissors.)\n\nAs for my answer, I could follow your code up until the last for loop. It seems to me that the upper bound for your loop should be i <= max (instead of max + 1), otherwise you end up one index beyond the last assigned value for your integer array a[].
384669
Java is also a programming language like VB, VB.Net, C, C++. So you can make any applications like MS-Word, Excel, Power-Point in Java. The main advantage of java applications is they are platform independant. Means you can run them on any operating systems. MS-Word, Excel etc can run only on Windows OS. But Java Applications are sligtly slower then the application developed on Microsoft Platform like VB.Net, VB etc.\n\nBut to make an operating system you cannot use Java. Because Java is made for application programming not for system programming. For operating Systems you need lot of System Programming. C and C++ are the best language for system programming. So, to develop Operating Systems C, C++ are widely used. But only C and C++ are still not enough to make an OS. You also need Assembly Level programming but Java cannot be used to develop an OS.\n\nAJAX stands for Asynchronous JavaScript And XML. It can be used for online applications. GMail and Google Pages uses AJAX. Now AJAX is also used in Beta version of Yahoo Mail.\n\nTo know about AJAX, you have to understand the general procedure of web pages.\n\nConsider a web page containing a form which accepts the data of user information like first name, last name, address etc. and store it to the database and then after display a message like "Thank you for submitting your information..."\n\nNow you fill up the data and click on the submit button. Now the following procedure occurs\n\n1) Your data is sent to the web server.\n2) Data is stored in the database.\n3) After data is stored, web server gives back a web page containing a message like "Thank you for submitting your information..."\n4) Your web browser accepts the response from web server and display the page.\n\nHere, after clicking on submit button you have to wait until the data is stored and a new page is displayed.\n\nBut consider the example of Google Pages. In google pages during saving your page, the page is not refreshed. You can keep your editing page while your page is being saved. This happens because of AJAX.\n\nWith AJAX you can receive and send data from web server without refreshing the whole page.\n\nTo learn about AJAX, follow the link\nhttp://www.w3schools.com/ajax/default.asp\n\nThis can give you a basic idea of AJAX.
290350
At least on the Linux/Solaris machines that I use,\nyou need to "wrap" your java class file with a\nscript which invokes the Java run time system.\nThis also gives you an opportunity to pass\nflags into the runtime (ie. to increase the\ndefault heap size, tweak the GC settings,\netc).\n\nFor example, for the class file "foo.class",\nthe script might be a single line like:\n\njava foo\n\n\nThen you would invoke the *script* rather\nthan trying to directly invoke the class\nfile.
50107
Java is a programming language for computers. Based on C++ it is a highly OOL (Object Oriented Language).\n\nIt allows developers to create programs you use every day... from calculators to advanced image editors to word processors.\n\nUnlike many other languages, Java is cross-platform. This means that the same code will work on a Windows machine, a Macintosh, or Linux/UNIX.\n\nThe first link below goes to Sun's Java developer site with information and documentation on the Java programming language.\nThe second is a website based on Java technology. There are programs and applets, created using Java, that you can use. There are plenty of games for you to try.\n\nAn example of a large program written in Java is OpenOffice. OpenOffice is a free, open-source alternative to Microsoft's Windows Office suite. OpenOffice is written in Java.\nThe third link leads to the OpenOffice website.
36414
1. Java is highly secure:- Java applets cannot access memory space other than the one which is assigned to it on the host system. So, there is a reduced chance of applets running on your system and creating problems.\n\n2. Java is distributed:- Features like RMI (remote method invocation) allow a Java program to invoke a method of an object residing on a remote system (or a different JVM). This is needed in a distributed environment. JavaBeans and CORBA are also essential in a networked environment.\n\n3. Java is robust:- Java programs are quite sturdy (although compiling takes slightly more time time vis-a-vis C). The compiler converts the .java source codes into .class files which can be run on any OS with the appropriate interpreter. (This means compiling .java files into .class files in Linux and running them on Windows is possible.)
647061
presently java is the best. more opportunities. easy to get job. challenging programming.
219563
Well, they both take a lot of time! And, I must see the algorithm of (....;)! When both take a lot of time, We should check the one which takes the less time! If both takes the same time, we should choose the one which takes less space (Memory space I mean) But generally, Prefer the 2nd one! I think we should try to use a general code or function in the second choice! If there isn't a general rule, then, I prefer using the 1st one, cause it takes less memory and the lines of codes will be less I suppose...
344228
Never, c++ is so much better for time dependent applications.  You can't imagine how much energy is devoted in a game to memory management to optimize it to the fullest.  A Java programmer doesn't even know what memory management is!\n\nCould you imagine stalling while playing because the garbage collector just kicked in?
371109
I code almost exclusively in ASM and binary for most CPU architectures out (very old through new), and haven't gone insane because of it. Thats not to say I wasnt insane before I started programming. :)
90264
Fifth generation languages are most likely to be considered both more complex and more powerful because they abstract the computer's functions more than any other generation of languages.  That is, the programmer using a fifth generation language can accomplish more with less effort than in other languages of earlier generations.  This is not always the most efficient way to program for reasons of platform architecture limitations, OS dependancies and compiler availability.  It also may have other drawbacks that mean it can't be reliably used in some mission critical software.  The real "best" programming language is the one that is appropriate to the project being coded.  For example, assembly language; a second generation language, is appropriate in embedded applications where data storage and timing are in need of exact control.  C is a "no-brainer" if you intend to use the Win32 API since it is its native language, so to speak.  These are just two minor examples of reasons different languages are important.  Yes, the latest and greatest get a good deal of attention and we can't stop inventing new languages, but don't forget the "predecessors" quite yet, either.
487057
Using lines of code to measure a programmers productivity is completely invalid.\nThe statement that the best programmers use the least amount of code is also inaccurate.   Sometimes the least amount of code can make applications cryptic and difficult to maintain.
319367
I'd put my bet on .NET for a more business related reason. Companies are having a tough time keeping JAVA apps around and trying to get them to play nice with newer JAVA Apps. Take ADP for instance. It's latest patch runs on the 1.4.2_08 interface. Kronos's latest implementation runs on 1.5.xxxx. Unfortunately you can't have a browser window up and running with both JAVA versions running at the same time.\nYou're fine if you start Kronos, and then start ADP. JAVA will interpret this correctly, and be able to roll itself back for compatibiltiy. However if you have the ADP App open, surfing to a Kronos App will result in a fairly serious Browser crash. Working for Attorneys, this is a serious issue. They don't like their data going away mid stream.\nFor browser apps, .NET is really a better choice because you get nearly straight HTML out of the server. You don't really need to worry about what version of the framework is installed on your desktop machine. For windows apps, all versions of the framework can be running apps at the same time thanks to a sweet little feature called side by side installations. JAVA doesn't play nice in side by side apps.\nThe Frustration factor alone keeps me away from JAVA coding.
13361
Java provides the StringBuffer and String classes, and the String class is used to manipulate character strings that cannot be changed. Simply stated, objects of type String are read only and immutable. The StringBuffer class is used to represent characters that can be modified.\n\nThe significant performance difference between these two classes is that StringBuffer is faster than String when performing simple concatenations. In String manipulation code, character strings are routinely concatenated. Using the String class, concatenations are typically performed as follows:\n\n\n     String str = new String ("Stanford  ");\n     str += "Lost!!";\n\nIf you were to use StringBuffer to perform the same concatenation, you would need code that looks like this:\n\n\n     StringBuffer str = new StringBuffer ("Stanford ");\n     str.append("Lost!!");\n\nDevelopers usually assume that the first example above is more efficient because they think that the second example, which uses the append method for concatenation, is more costly than the first example, which uses the + operator to concatenate two String objects.\n\nThe + operator appears innocent, but the code generated produces some surprises. Using a StringBuffer for concatenation can in fact produce code that is significantly faster than using a String. To discover why this is the case, we must examine the generated bytecode from our two examples. The bytecode for the example using String looks like this:\n\n\n0 new #7 <Class java.lang.String>\n3 dup\n4 ldc #2 <String "Stanford ">\n6 invokespecial #12 <Method java.lang.String(java.lang.String)>\n9 astore_1\n10 new #8 <Class java.lang.StringBuffer>\n13 dup\n14 aload_1\n15 invokestatic #23 <Method java.lang.String valueOf(java.lang.Object)>\n18 invokespecial #13\n21 ldc #1 <String "Lost!!">\n23 invokevirtual #15 <Method java.lang.StringBuffer append(java.lang.String)>\n26 invokevirtual #22 <Method java.lang.String toString()>\n29 astore_1\n\nThe bytecode at locations 0 through 9 is executed for the first line of code, namely:\n\n\n     String str = new String("Stanford ");\n\nThen, the bytecode at location 10 through 29 is executed for the concatenation:\n\n\n     str += "Lost!!";\n\nThings get interesting here. The bytecode generated for the concatenation creates a StringBuffer object, then invokes its append method: the temporary StringBuffer object is created at location 10, and its append method is called at location 23. Because the String class is immutable, a StringBuffer must be used for concatenation.\n\nAfter the concatenation is performed on the StringBuffer object, it must be converted back into a String. This is done with the call to the toString method at location 26. This method creates a new String object from the temporary StringBuffer object. The creation of this temporary StringBuffer object and its subsequent conversion back into a String object are very expensive.\n\nIn summary, the two lines of code above result in the creation of three objects:\n\n   1. A String object at location 0\n   2. A StringBuffer object at location 10\n   3. A String object at location 26\n\nNow, let's look at the bytecode generated for the example using StringBuffer:\n\n\n0 new #8 <Class java.lang.StringBuffer>\n3 dup\n4 ldc #2 <String "Stanford ">\n6 invokespecial #13 <Method java.lang.StringBuffer(java.lang.String)>\n9 astore_1\n10 aload_1\n11 ldc #1 <String "Lost!!">\n13 invokevirtual #15 <Method java.lang.StringBuffer append(java.lang.String)>\n16 pop\n\nThe bytecode at locations 0 to 9 is executed for the first line of code:\n\n\n     StringBuffer str = new StringBuffer("Stanford ");\n\nThe bytecode at location 10 to 16 is then executed for the concatenation:\n\n\n     str.append("Lost!!");\n\nNotice that, as is the case in the first
335269
Of course you'll se the difference! Not mainly in speed but mostly regarding the entire ysstem stability.. The only problem is that at this time many applications are still written in 32-bit and eventualy don't support 64-bit applications. It's the only disadvantage, and I could say minor because very soon 64 bit will be the new standard for cpu processing!