answersLogoWhite

0

What is use of dot operator in java?

Updated: 10/26/2022
User Avatar

Sangameshwar

Lvl 1
12y ago

Best Answer

"the dot" connects classes and objects to members. The places where you use it in what I cover are:

(1) when you are connecting an object reference variable to a method. The Extending Existing Classes lesson introduces the dot operator for this use, and

(2) when you are connecting a class name to one of its static fields. An example of this is the dot between "System" and "out" in the statements we use to print stuff to the console window. System is the name of a class included in every Java implementation. It has an object reference variable that points to a PrintStream object for the console. So, "System.out.println( "text") invokes the println() method of the System.out object.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is use of dot operator in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Explain the role of sizeof operator in java?

There is no sizeOf() operator in Java.


The multiplication operator is represented in Java by what symbol?

In Java, the multiplication operator is represented by the asterisk, "*". This was not invented by Java; most programming languages, as well as programs such as Excel, use the same symbol.


Which operator works like sizeof operator in Java?

Java does not have the sizeOf() operator or any operator that gives an equivalent result.


Why java does not use sizeof operator?

Sizeof() is not needed because Java basic types sizes are fixed


Why is the multiplication operator represented by symbol?

In Java, the multiplication operator is represented by the asterisk, "*". This was not invented by Java; most programming languages, as well as programs such as Excel, use the same symbol.


Operator overloading is possible in java or not?

Java does not support opperator overloading, so the answer to your question is: none.


When to use the dot operator and when to use the arrow operator in c plus plus?

You use the dot operator when the left side is the name of the object or a reference to an object, and you use the arrow operator when the left side is a pointer to an object. Example: struct foobar x, *p= &x; x.field = p->field; (&x)->field = (*p).field;


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 method call in java?

Calling a method in Java is when you run code associated with a specific class, using the name of an instance object of a class, followed by the dot operator, followed by the name of the method, followed by the arguments of the method, enclosed in parentheses.


What is operator in java?

An operator is a symbol that does something in Java. for ex: "+" is an arithmetic operator that adds two numbers. ">" is a logical operator that checks if one number is greater than the other. There are many different types of operators in Java like Arithmetic, Logical, Relational and Assignment operators


Difference between equals equals and equal in java?

"==" in java is the binary operator which compares two values and gives a boolean result While "=" in java is a assignment operator which assigns a value to a variable.


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++