What are the key differences between Python and Java?

  • Context: Java 
  • Thread starter Thread starter Carina5738
  • Start date Start date
  • Tags Tags
    Python
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 2K views
Carina5738
Messages
3
Reaction score
0
Hello all,

If this has been asked before, please forgive me; what can Python be used for? Is it good for programming apps and whatnot? I have never done any programming before, so this is my very first programming language that I have just started learning.

Thanks for answering
 
Physics news on Phys.org
Python in recent years has been, from what I've heard, increasingly used in scientific and statistical computing. You can make programs that do whatever you want with it. If you're talking about mobile apps, though, Android apps are coded mostly in Java while iOS apps are coded in Objective C.
 
Oh, oh okay. Is Java harder than python?
 
Java is different than Python. Some would say that programming languages aren't necessarily "harder" than one another, but speaking from my point of view, I would say that yes, jumping into Python as a first-time programmer is much easier than Java.

That said, while they're different programming languages, the same concepts appear all throughout programming and computer science, and if you understand those concepts, switching languages isn't too big of a deal.
 
  • Like
Likes   Reactions: jim mcnamara
Coolios. Thank you!
 
axmls said:
Java is different than Python
In what way are they different? Both are Object Oriented Programming languages. Of course they are different but no language is the same with others.

In my use of Python I consider it to be a pretty simple language to learn, but reading through python code I can easily get confused with the return types of different methods or functions (since it doesn't have type initializations).
 
Python is interpreted whereas Java is compiled. In Java, everything is in a class, whereas classes aren't required in Python. Of course, types must be specified when created a variable in Java, unlike in Python. Java uses braces whereas Python uses indentation. Obvious syntax differences.

Of course, those are the same differences as in all languages, but the big one is the class-oriented approach Java takes, which can be confusing for someone who has no idea what a class is. I prefer the nice and simple buildup to object oriented programming that Python allows you to do.