This week's book giveaway is in the XML and Related Technologies forum.
We're giving away four copies of Java XML & JSON and have Jeff Friesen on-line!
See this thread for details.
Win a copy of Java XML & JSON this week in the XML and Related Technologies forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Why does JavaScript not have Classes like Java ?  RSS feed

 
Ranch Hand
Posts: 1025
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does JavaScript not have Classes like Java.

Thanks.
 
Marshal
Posts: 67224
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript does have classes. You need to get up to date with the latest versions of JavaScript (EcmaScript 6 and beyond).

That said, the classes aren't identical to Java classes, but I'm pretty sure that's not what you meant. (In which case the question would have been "Why aren't JavaScript classes identical to Java classes?")
 
Bear Bibeault
Marshal
Posts: 67224
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the pro-active answer in case the question was "Why aren't JavaScript classes identical to Java classes?" is that the classes of any language other than Java are not identical to Java classes; why would JavaScript be any different?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript is a object oriented language hence it does not need classes.
 
Saloon Keeper
Posts: 5219
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

roshani sen wrote:JavaScript is a object oriented language hence it does not need classes.


There is a strong connection between objects and classes in general, even if they're not named exactly that. Not an absolute one, but as pointed out, JavaScript does have classes. So this statement is incorrect on more than one level.
 
Attractive, successful people love this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!