answersLogoWhite

0


Best Answer

There are 5 operators which cannot be overloaded. They are:

* .* - class member access operator

* :: - scope resolution operator

* . - dot operator

* ?:: - conditional operator

* Sizeof() - operator Note:- This is possible only in C++.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

The following C++ operators cannot be overloaded...

  • . Member selection
  • .* Pointer to member selection
  • :: Scope resolution
  • :> Base operator
  • ?: Conditional
  • # Preprocessor symbol
  • ## Preprocessor symbol
This answer is:
User Avatar

User Avatar

Wiki User

15y ago

No, java does not support explicit operator overloading. You can use an operator only for its intended purpose. But the "+" operator is implicitly overloaded. It can be used to add two numbers as well as concatenate two strings. Apart from this operator all other operators can be used only for their specific purpose.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the operator that cannot be overloaded?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the disadvantages of scope resolution operator?

it cannot be operator overloaded.


Which operator cannot be overloaded c plus plus?

comma (,) is an example


What is the operator that cannot be overloaded in c plus plus and java?

conditional operator , size of operator , membership operator and scope resulation operator can not be overload in c++


How can you differentiate overloading of pre-fix and post-fix increment operator?

The prefix increment operator is overloaded as operator++() while the postfix increment operator is overloaded as operator++(int).


Which c plus plus operators cannot be overloaded?

1. Member-of operator (.) 2. Pointer-to-member-of operator (.*) 3. Ternary condition operator (?:) 4. Scope resolution operator (::) 5. sizeof operator 6. typeid operator


What are special operators in c plus plus?

The only "special" operators in C++ are those that cannot be overloaded. That is; the dot member operator (.), pointer to member operator (.*), ternary conditional operator (:?), scope resolution operator (::), sizeof() and typeof().


Why ternary operator is not overloaded?

The ternary operator (known as the conditional operator in C++) cannot be overloaded because it is impossible to pass a test operand and two expression operands (either or both of which may be comma-separated) to a function. You can only pass values or references as arguments to a function. Even if it were possible, built-in functions and operators that rely on the conditional operator would likely break. Like all the other operators that cannot be overloaded (sizeof, typeid, ::, . and .*) the results must always be predictable because built-in operators and functions rely on them so heavily.


Can the scope resolution operator be overloaded in C plus plus?

No.


How can you can create a new operator through operator overloading?

You cannot create any new operators in C++. You can only overload the existing ones (although some, such as sizeof, new and delete cannot be overloaded). The only way to create a new operator is to implement it as a standard function with a named identifier. For instance, sqrt() is the standard library function that provides the square root operator, for which no real operator exists.


What are the restriction that are applied to operator overloading?

Java does not support user defined operator overloading.The operator '+' is overloaded in Java and can be used for adding both numbers and Strings.


What is the correct declaration of the assignment operator overloaded function inside the travel class?

class travel {...travel &operator=( some type );... or ...travel operator=( some type );...};


How many arguments are required in the definition of an overloaded unary operator?

any number of arguments