What are the differences between Java and Python?

Source: Internet
Author: User

Reply content:

Facing the market, look at the company personnel situation, the company large, large projects, many people, mobile, on Java, because the standard, the old man took the new person easy to take over.
Company small, few people, small projects, staff active, not often substitutions, on Python, so the project progress of the miso. Java is a high-level language (high-level programming language) and Python is a very high-level language (Very-high-level language [1]).
[1]: / http Docs.python.org/tutoria l/appetite.html JAVA introduces the package, the way to call the package is more concise than Python, and the Python direct import package is explicit, there is no module/class conflict with the same name, if you use the "From module import function", The use of the time is also very concise but requires the need to have a targeted reference to the function.
Blocks in JAVA are enclosed in curly braces, and Python is represented by a colon + four-space indent.
The type of JAVA to declare, the type of Python is not required.
JAVA is basically a class/struct operation, which is object-oriented, and Python can handle logic in a separate function module without having to put it into a class.
Each line of the JAVA statement ends with a semicolon, and Python does not write semicolons.
Strings in JAVA are enclosed in double quotation marks, and either single or double quotes in Python (as with JavaScript).
When you implement the same functionality, JAVA usually knocks more keyboards than Python.

... ... Python is also strongly typed.
The strength type does not refer to whether it needs to be defined, but whether it can be arbitrarily converted once the type is determined.

The differences between Java and Python are static types and dynamic types, static types must be declared and reused, and dynamic does not need to be declared. I said one: After the completion of Python people should most do not like to learn Java ...
    • Python syntax is more concise
A complete Python HelloWorld program as long as one line of code:
print("Hello World")
Appeared in 1995
Appeared in1991 curly braces and ending commas I'm still more used to it. Is that a problem? Difference
One, Python virtual machine is not Java strong, Java Virtual machine is the core of Java, Python's core is easy to use C language functions or C + + library.

Second, Python is fully dynamic, you can modify their own code at run time, Java can only be implemented by the workaround. Python's variables are dynamic, while Java variables are static and need to be declared beforehand, so the Java IDE's code hinting is better than the Python IDE.

Three, Python has been produced for decades, decades ago, the process is mainstream, so Python has a lot of programs with a process-oriented design approach, a lot of concepts from the C language, class in Python is added later, and Java is to implement a C + + without pointers (The reference count for the current COM component, the virtual machine used in Java), the main use of object-oriented design methods, many concepts are the concept of OOP. Process-oriented, relatively concise and intuitive, but easy to design a noodle program, object-oriented, relatively abstract elegant, but easy to over-abstract.

Four, in the actual use of Python to get started simple, but to learn to work with Python, you need to learn python various libraries, Pyhton's power lies in the library, why Python library is powerful, because the Python library can be used in python,c language, C + + and other design, Provided to Python, so no matter GPU running, neural networks, intelligent algorithms, data analysis, image processing, scientific computing, a variety of libraries are waiting for you to use. Java does not have as many open-source libraries as Python, many of which are used internally by commercial companies, or are released as just a jar package, without seeing the original code. Python virtual machine Because the compiler does not have the support of Java good (or intentionally so designed), generally direct use of the source code (Linux), or the source code simply to make a package (such as Pyexe).

Python has a lot of virtual machine implementations, such as Cython,pyston,pypy,jython, IronPython, etc., suitable for business language, or plug-in language, or domain-oriented language, and Java because of the huge virtual machine, rarely used in the plugin language, publishing is not convenient.

VI, Java is mainly used in the field of business logic strong, such as mall system, ERP,OA, finance, insurance and other traditional database transactions, through similar SSH framework transaction code, business database, such as Oralce,db2,sql server support better, software engineering concept Strong, Suitable for software engineering type of multi-person development mode. Python is mainly used for web data analysis, scientific computing, financial Analysis, signal analysis, image algorithms, mathematical calculations, statistical analysis, algorithmic modeling, server operations, automated operations, rapid development concept strong, suitable for rapid development team or individual agile model.

Seven, the Java Commercial Company supports many, such as SAP,ORACLE,IBM, has the commercial container, the middleware, the Enterprise framework EJB. Python's Open source organization supports many, such as Qt,linux,google, and many open source programs support Python, such as Pyqt,redis,spark.

Eight, Python uses most of the script, Java uses the most is Web,pyhotn is glue, can be all kinds of irrelevant things stick together, Java is a gay, can be composed of software engineering hundreds of people team and you PK, commercial breath heavy. However, I think Python is powerful because it makes it easy to call C or C + + libraries, but software engineering and commercialization are not as good as Java and are suitable for quick development.

Nine, about money.

If you want to write programs selling software with Java, available on IBM servers, on Oracle database, on EMC storage, high prices, commercial procurement companies like this tall on. If you want to use the program directly to generate money with Python,python can achieve wide customer finance, data back test, fry, speculation options, fried gold, fried bitcoins, hedging arbitrage, statistical arbitrage, there are many open source libraries, data Analysis Library, machine learning library can be referenced.

Ten, Java and Python can all run on Linux operating system, but many Linux can natively support Python,java need to install itself. Java and Python are stronger than C # in favor of Linux, support for OSX, support for UNIX, and arm support. Java and Python are more popular than C + + because pointers are not needed.

For mobile internet, Python can only be run by the runtime on Android or Ios,java native support for Android development, but not in iOS.

12. For big data, Hadoop is open in Java, Spark is developed in Scala, and it is more convenient to call spark again with Python.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.