Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (1.5k points)
Can anybody give me an easy explanation of the Java dot operator and its significance?

1 Answer

0 votes
by (1.4k points)

The (.) operator is also called a member operator which is used to access the member of a package or a class. 

Example: 

public class test { 

   void display() { 

      double d = 89.3; 

      int i = (int)d; 

      System.out.println(i); 

   } 

   public static void main(Strinargs[]) { 

      Sample s = new Sample(); 

      s.display(); 

   } 

} 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Feb 20, 2021 in Java by Jake (7k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...