In this tutorial you will learn about the Java Dot Operator and its application with practical example.
Java Dot(.) Operator
The dot (.) operator is also known as the member operator it is used to access the member of a package or a class.
Example:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
public class Main { void display() { double d = 15.3; int i = (int)d; System.out.println(i); } public static void main(String[] args) { Main m = new Main(); System.out.println("W3Adda - Java Dot Operator Example"); m.display(); } } |
Find the java program output here, please take a look:
Output:-