Interview Question


Country: India




Comment hidden because of low score. Click to expand.
1
of 1 vote

In java operator overloading is not supported

- Learn Android: http://learnandroideasily.blogspot.in/ March 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yep, it's not directly supported. If you really wanted to have it, you'd have to implement some kind of preprocessor that would go through your files and paste some code wherever you have a + symbol. Wouldn't be all that easy to get right.

- eugene.yarovoi March 10, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

it would be very grt if u'll elaborate you thought. I m really interested to try this out.

- Sam March 10, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

That's really imaginative eugene.yarovoi. Although technically it won't be operator overloading in java, if the pre processing is done as part of the build process, it would seem like so. Find arithmetic expressions and convert that to call say add method. cool.

- dc360 May 26, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Operator overloading is not possible in Java.

- Niranjan Kulkarni March 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

+ is overloaded in java, isnt it?

- nr March 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

u mean operator overloading with strings. That is only internally implemented, we cannot overload an operator explicitly.

- The Coder March 09, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Operator overloading already exists in Java. How often have you used "+" and "+=" to concatenate strings...?

- expert March 09, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In Java operator overload doesn't require. It is bcoz all data are accepted through string by JVM so there is no need of having operator overload. It is only the concept of C++ and has a huge role there.

- Amal March 09, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

not supported like in c++

- Anonymous March 09, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More