LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-12-2004, 09:54 AM   #1
Tesl
Member
 
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, 10:37 AM   #2
adamjaskie
Member
 
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, 10:39 AM   #3
Cand1e
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-13-2004, 12:27 AM   #4
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
Java doesn't support operator overloading.
 
Old 02-13-2004, 01:54 AM   #5
UltimaGuy
Member
 
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 .
 
  


Reply


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 08:45 PM
Operator Overloading problem ashwinipahuja Programming 1 06-23-2004 06:59 AM
c++ [] operator overloading exodist Programming 12 04-17-2004 04:06 PM
C# with dotGNU, operator overloading exodist Programming 2 03-15-2004 06:52 PM
C++ overloading extraction operator petercool Programming 5 09-06-2003 07:35 AM


All times are GMT -5. The time now is 06:46 PM.

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