So we can easily store their value in Boolean expression
Using this Method we can easily check conditions instead of testing these scenarios in IF-ELSE condition .
---Example of Storing Expression Value in PLSQL
---Example of Storing Expression Value in PLSQL
--By mFaisal
declare
lExpressionValue boolean;
begin
--- Expression Value
lExpressionValue:=1=2 or 2=2;
-- Is True Then
---1
---else
--2
if lExpressionValue Then
--1
DBMS_OUTPUT.put_line('Expression is
True..');
else
--- 2
DBMS_OUTPUT.put_line('Expression is not True..');
end if;
end;
Example of JAVA Code
public class Server {
public static void main(String[] args) {
Server.isTrue((1==2));
//isTrue((1=1)));
}
public static void isTrue(boolean expression) {
if (expression) {
System.out.println("Expression is true.");
}
else
{
System.out.println("Expression is not true.");
}
}
}
No comments:
Post a Comment