164k views
4 votes
How would you declare a variable x of type double and set it equal to 25.25? In JAVA

How would you declare a variable x of type double and set it equal to 25.25? In JAVA-example-1
User Juvenik
by
7.0k points

1 Answer

7 votes

In java, you have to use the double keyword.

double x = 25.25;

You have to end the statement with a semi-colon. I hope this helps!

User Patc
by
6.7k points