Menu

#14 Problem with return statement

open
5
2008-09-09
2008-09-09
No

Class:

package test;

public class Test
{
String test(boolean a)
{
try
{
if (a)
return null;
} catch (Exception e)
{
return null;
}

return "";
}
}

decompiles into:

// Decompiled by jdec
// DECOMPILER HOME PAGE: jdec.sourceforge.net
// Main HOSTING SITE: sourceforge.net
// Copyright (C)2006,2007,2008 Swaroop Belur.
// jdec comes with ABSOLUTELY NO WARRANTY;
// This is free software, and you are welcome to redistribute
// it under certain conditions;
// See the File 'COPYING' For more details.

package test;

/**** List of All Imported Classes ***/

import java.lang.Exception;
import java.lang.Object;
import java.lang.String;

// End of Import

public class Test

{

// CLASS: test.Test:
public Test( )
{
super();
return;

}

// CLASS: test.Test:
String test( boolean a)
{
try
{
if(a!=false)
{

}

}
catch(Exception e)
{

}
return null;
return "";

}

}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB