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.
Tweet
SaveShareSend
Tags: java, methodology, opinion, other languages
Comments
eelmore replied ago:
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.
sproketboy replied ago:
Java doesn't support it because it's a really bad idea. Only shit languages like C# support shit.
eelmore replied ago:
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)
sproketboy replied ago:
Dude if you don't understand why operator overloading is a bad idea then you're a fuktard loser.
eelmore replied ago:
sure thing, kid.
sproketboy replied ago:
Glad you agree.
eelmore replied ago:
Whatever you say, kid.
Voters For This Link (9)
Voters Against This Link (4)