Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 9e9fbbefd2001d780f31040381fe729b > files > 52

bsh-manual-1.3.0-37.mga6.noarch.rpm

<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Strict Java Mode</title></head><body bgcolor="ffffff"><table cellspacing="10"><tr><td align="center"><a href="http://www.beanshell.org/"><img src="../images/homebutton.gif"><br>Home</a></td><td><a href="commands.html#Adding_BeanShell_Commands"><img src="../images/backbutton.gif"><br>Back
			</a></td><td align="center"><a href="contents.html"><img src="../images/upbutton.gif"><br>Contents</a></td><td align="center"><a href="classpath.html#Class_Loading_and_Class_Path_Management"><img src="../images/forwardbutton.gif"><br>Next
			</a></td></tr></table><h1>Strict Java Mode</h1>


<em>Note: Strict Java Mode is new and currently breaks some BeanShell tools
and APIs when activated.  The GUI desktop and most BeanShell commands 
will not work with strict Java mode enabled.  
Please see notes at the end of this page</em>
<p CLEAR="ALL"></p>

If you are a Java teacher or a student learning the Java language and
you would like to avoid any potential confusion relating to BeanShell's
use of loose variable types, you can turn on Strict Java Mode.  Strict
Java Mode is enabled with the the setStrictJava() command.

When strict Java mode is enabled BeanShell will require typed variable
declarations, method arguments and return types.

For example:
<p></p><center><table width="100%" cellpadding="5" border="1"><tr><td bgcolor="#dfdfdc"><pre>
setStrictJava(true);

int a = 5;

foo=42; // Error! Undeclared variable 'foo'.

bar() { .. } // Error! No declared return type.
</pre></td></tr></table></center><p></p>


<table cellspacing="10"><tr><td align="center"><a href="http://www.beanshell.org/"><img src="../images/homebutton.gif"><br>Home</a></td><td><a href="commands.html#Adding_BeanShell_Commands"><img src="../images/backbutton.gif"><br>Back
			</a></td><td align="center"><a href="contents.html"><img src="../images/upbutton.gif"><br>Contents</a></td><td align="center"><a href="classpath.html#Class_Loading_and_Class_Path_Management"><img src="../images/forwardbutton.gif"><br>Next
			</a></td></tr></table></body></html>