Link Details

Link 934913 thumbnail
User 1099869 avatar

By marina.sprava
via blog.jelastic.com
Published: Mar 07 2013 / 10:08

Unlike C++ java doesn’t provide freedom to programmer to overload the standard arithmetic operators e.g. +, -, * and /, Java has left lot of feature supported in C++ e.g. Java doesn’t support multiple inheritance, no pointers in Java and no pass by reference in java. Rarely this question asked in interview to check how programmer thinks about certain features which java doesn’t have. Though I don’t know the real reason behind it I think following observation make sense on why Operator overloading is not supported in Java.
  • 9
  • 4
  • 1320
  • 984

Comments

Add your comment
User 218789 avatar

eelmore replied ago:

1 votes Vote down Vote up Reply

Ok, so basically Java doesn't support operator overloading because they think java programmers are too dumb to handle it? That's what it sounds like you said.

User 187417 avatar

sproketboy replied ago:

-1 votes Vote down Vote up Reply

Java doesn't support it because it's a really bad idea. Only shit languages like C# support shit.

User 218789 avatar

eelmore replied ago:

0 votes Vote down Vote up Reply

My, someone sounds a little butt-hurt and at the same time seems to think Java is somehow immune to bad language design. This one little aspect alone is a pretty big flaw. The mere ability to overload operators doesn't make it bad--bad programmers screw it up. Don't blame the very concept of operator overloading. When it makes logical sense to add two objects together "object1 + object2" makes a lot more sense than object1.GetValue().ToPreferredNumericType().WhateverJavaEsqeBS(object2.blahblahblah)

User 187417 avatar

sproketboy replied ago:

-1 votes Vote down Vote up Reply

Dude if you don't understand why operator overloading is a bad idea then you're a fuktard loser.

User 218789 avatar

eelmore replied ago:

-1 votes Vote down Vote up Reply

sure thing, kid.

User 187417 avatar

sproketboy replied ago:

-1 votes Vote down Vote up Reply

Glad you agree.

User 218789 avatar

eelmore replied ago:

-1 votes Vote down Vote up Reply

Whatever you say, kid.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java