Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-12-2004, 08:54 AM   #1
Registered: Jun 2003
Location: Durham, UK
Distribution: Slackware 9, Mandrake 9.1
Posts: 163

Rep: Reputation: 30
Operator Overloading - Java?

Iv not been able to find anything on this, and if i could get a response to this in the next couple of hours that would be great

Basically, is it possible? iv always found operator overloading helpful in C++, and i was hoping i could do something similar with Java, but i cant find how to do this?

If anyone could let me know how its done it would be greatly appreciated Otherwise il just have to live without =/
Old 02-12-2004, 09:37 AM   #2
Registered: Feb 2004
Posts: 32

Rep: Reputation: 15
Im pretty sure it can't be done. Java apparently doesn't have this feature. I wish it did. Was very nice when I was doing C++.
Old 02-12-2004, 09:39 AM   #3
LQ Newbie
Registered: Feb 2004
Location: Location, Location.
Distribution: Debian / XP
Posts: 6

Rep: Reputation: 0
no-can-do I'm afraid what are you trying to do anyway? I might be able to suggest a way 2 do it in java.
Old 02-12-2004, 11:27 PM   #4
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
Java doesn't support operator overloading.
Old 02-13-2004, 12:54 AM   #5
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 31
Java doesn't offer users operator overloading. But it uses operator overloading. The "+" symbol in print statements is an overloaded operator. But the Java creator's thought that programmer's don't need this feature and so didn't provide it.

The prescribed method is to use functions, functions and more functions. You can use function overloading though, which is helpful .


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with overloading operator+ in C++ niteshadw Programming 13 07-20-2005 07:45 PM
Operator Overloading problem ashwinipahuja Programming 1 06-23-2004 05:59 AM
c++ [] operator overloading exodist Programming 12 04-17-2004 03:06 PM
C# with dotGNU, operator overloading exodist Programming 2 03-15-2004 05:52 PM
C++ overloading extraction operator petercool Programming 5 09-06-2003 06:35 AM

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration