155k views
0 votes
Write an expression that evaluates to true if and only if the value of the boolean variable workedovertime is true.

User Malla
by
8.1k points

1 Answer

4 votes

Answer:

import java.io.*;

public class WorkedOvertime

{

public static void main (String[] args)

{

boolean workedovertime = false;

if ( workedovertime )

{

System.out.println("Evaluates to True");

}

else

{

System.out.println("Evaluates to False");

}

}

}

Step-by-step explanation:

This simple java program evaluates to true if and only if the value of the boolean variable workedovertime is true.

User Daronwolff
by
7.9k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.