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
4.3k 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
4.1k points