Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2006, 06:41 AM
Registered User
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Java Code using labels

Here is a piece of code from a file JDBCFormatter written by someone else
             catch(Exception e) { }
            if(true) goto _L2; else goto _L1;
_L1:
            theConnection.destroy(theConnection);
            theConnection = null;
            break MISSING_BLOCK_LABEL_653;
            Exception e;

        }

Here label is used (_L1) but this cod eis not compiling becuase of syntax error at line if(true)" goto _L2; else goto _L1;"

Can someone suggest something how to complete this code



 
Old May 4th, 2006, 08:49 AM
Authorized User
 
Join Date: Apr 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vakorde
Default

Modify this code as
if(true)
{ /* code of the L2 location */
}else {
  // initialise theConnection
  theConnection.close();
  theConnection = null;
  new Exception();
}

---------------------------
Vikrant Korde
3i Infotech, Vashi,
Mumbai, Maharashtra, India.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Java script code kethireddy435 Javascript 1 July 30th, 2008 01:50 PM
Java Script from code behind jagdishnc ASP.NET 1.0 and 1.1 Basics 0 January 22nd, 2008 06:37 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM
Code in Java for priority queue kishor_shrestha Java GUI 3 November 13th, 2004 08:08 PM
Java code problem Loevet J2EE 5 October 23rd, 2003 08:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.