What are the functions of the dot(.) operator? (Select multiple)

A) It enables you to access instance variables of any objects within a class
B) It enables you to store values in instance variables of an object
C) It is used to call object methods
D) It is to create a new object

Showing Answers 1 - 26 of 26 Answers

prajkta

  • Feb 1st, 2006
 

It enables you to access instance variables of any objects within a class

It is used to call object methods

Ex;Xyz x=new Xyz ();

here x.n=10;

x.display();

  Was this answer useful?  Yes

i think all the above is trueeg: Test t=new Test();1) dot operator is used to access instance variables of an object eg:System.out.println(t.x);2)dot operatore is used to store values of instance variable in a classeg:t.x=10;3)dot operator is used to call method of an object of that classeg:t.methodOne();4) dot opertor is used to create an object in the inner classeg public class TopLevelClass {public class InnerClass{public methodOne(){System.out.println("printing from inner class method");}}public methodToplevel(){System.out.println("i am toplevel class method");}}if u want to create an object of innerclass we use dot opertorTopLevelClass.InnerClass tlic =new TopLevelClass.InnerClass();

  Was this answer useful?  Yes

aaa

  • Oct 9th, 2011
 

c

  Was this answer useful?  Yes

sonal

  • Sep 7th, 2015
 

A) It enables you to access instance variables of any objects within a class

  Was this answer useful?  Yes

Manjunath S.B

  • Apr 29th, 2016
 

A,B,C

  Was this answer useful?  Yes

Shashank Bilonia

  • Aug 24th, 2016
 

A, B, C

  Was this answer useful?  Yes

jagdish

  • May 16th, 2017
 

This is use for combine

Code
  1. <?php

  2. $a= "hello friend";

  3. echo      "<br>".$a."</br>";

  4. ?>

  5. //this is use for combine

  Was this answer useful?  Yes

Lakhvir chahal

  • Dec 15th, 2017
 

It is used to call object method

  Was this answer useful?  Yes

Saurabh kumar gupta

  • Feb 4th, 2018
 

It enables you to access instance variables of any objects within a class

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions