Home Discussion Discuss: Java error unreachable statement

  • Solve "Continue"Guru September 4, 2011 at 11:58 AM

    Dear, You can not write "Continue" keyword in without condition block, It must be write into like "IF" condition block.. Try it.. if(i==3) { continue; }

  • Unrechable statementsAnkur Jain October 25, 2012 at 2:04 PM

    package com.lara; import java.util.Scanner; public class F { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter Some-Thing"); String s1 = sc.next(); int i = test(s1); System.out.println(i); } static int test(String s1) {int i = 0; try { i = Integer.parseInt(s1); return i; } catch (NumberFormatException ex) { return 0; } /*catch (ArithmeticException ex1) { System.out.println(7); System.out.println(ex1); System.out.println(8); }*/ finally { return 1000; } System.out.println(1); } }

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
General

Java error unreachable statement
Java error unreachable statement   ... a code that help you in understanding a unreachable statement. For this we have a class name' unreachable error', Inside the main method  we have 

JSP Servlet Questions

Unreachable code
Unreachable code  Sir, i am facing following problem, org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 50 in the jsp file: /refreshPage.jsp Unreachable code 47 

JDBC Questions

error : not an sql expression statement
error : not an sql expression statement  hii I am gettin followin error in connecting to database SQLserver 2005 in Jdeveloper,i m usin struts... { Connection conn = DatabaseManager.getConnection(); Statement stmt 

Programming Tutorials

The continue statement The continue statement is used in many programming languages such as C
Continue.java Continue.java:12: unreachable statement a = i; ^ 1 error If we write...The continue statement The continue statement is used in many programming languages such as C. The continue statement The continue statement is used 

Java Tips and Examples

Java - Continue statement in Java
Java - Continue statement in Java       Continue: The continue statement is used in many programming...:\chandan>javac Continue.java Continue.java:12: unreachable statement 

JDBC Questions

oracle insert statement error - JDBC
oracle insert statement error  hi.. please help me to insert a image into oracle 11g database and please say me how can i insert image from directory like G:\imagefolder\ultrasoundimage\02us02.jpeg please help me 

JSP Servlet Questions

error
error  I am running a program insert into statement in sql using.../ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest 

Java Beginners

syntax error in SQL Insert Statement - Java Beginners
Access Driver] Syntax error in INSERT INTO statement. plz Help Me  Hi...syntax error in SQL Insert Statement  Dear Sir ,I have write following code to save data into access databse, but code gives following error code 

Java Beginners

how to make an unreachable object as reachable - Java Beginners
how to make an unreachable object as reachable  i know that an object is garbagecollected when it is unreachable to the programmer but my question is how that unreachable object which was garbage collected will become 

General

Java error missing return statement
Java error missing return statement       Java error missing return statement are those error in Java that occurred when a programmer forget to write 

Java Beginners

syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement   private class ButtonListener implements ActionListener{ public void actionPerformed(ActionEvent ae...","",""); Statement stmt=con1.createStatement(); int i 

Java Beginners

Java Error In comapitable Type in statement - Java Beginners
Java Error In comapitable Type in statement  Here I want to Check...; //Statement st; faculty3() //constructor { j=new JFrame("faculty"); j1...(j1,"Error in submitting data!"); }//end catch }// end Action 

Java Tips and Examples

'if' Statement - if inside if
Java Notes'if' Statement - if inside if if inside if You can put... the condition in an if statement, Java thinks it's finished with the body... readers, is ignored by Java. This is another error that's harder to make if you 

Java Tips and Examples

if Statement - Overview
Java Notesif Statement - Overview Purpose The purpose of the if statement is to make decisions, and execute different parts of your program depending... with if. [The other 1% of the decisions use the switch/case statement 

Java Tips and Examples

if Statement - Overview
Java Notesif Statement - Overview Purpose The purpose of the if statement... in the scope of the if statement. This is a surprisingly common error... is a statement? A statement is a part of a Java program. We have already 

Java Beginners

GOTO Statement in java
GOTO Statement in java  I have tried many time to use java goto statement but it never works i search from youtube google but e the example on net are also give compile error. if possible please give me some code with example 

Java Tips and Examples

'if' Statement - Braces
Java Notes'if' Statement - Braces Braces { } not required for one statement If the true or false part of and if statement has only one... was expected. What is a statement? A statement is a part of a Java 

JDBC Questions

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.  String sql = "UPDATE emp_details SET empEname = ?, emailId = ?, guid =?, proximityCard =?, managerEmailId = ?, reviewerEmailId 

JDBC Questions

prepared statement in for loop - JDBC
prepared statement in for loop  Hi all, I am reding data from a jsp page and inserting into a table. For this i am using prepared statement...: sun.jdbc.odbc.JdbcOdbcBatchUpdateException: General error 

Java Interview Questions

for statement
for statement  for(int i=0;i<5;i++); { system.out.println("The value of i is :"+i); } if i end for statement what will be the output   got the answer.. it displays only the last iteration that is "The value of i 

JDBC Questions

Usage of setDate() in prepared Statement - JDBC
Usage of setDate in prepared Statement  Hi, I have created a jsp...() of prepared statement,the following error is displayed: setDate() not available in prepared statement. Basically, I need to accept the date dynamically 

Programming Tutorials

Understanding jQuery statement chaining
Understanding jQuery statement chaining       Understanding jQuery statement chaining JQuery provide statement chaining which can reduce the length of the code 

Swing AWT

how to pass the parameter in callable statement
how to pass the parameter in callable statement  calstat=conn.prepareCall("{call studentrc(?,?,?,?,?)}"); // it show error parameter value is null calstat.setString(1,tname.getText 

General

Java Import Statement Cleanup - Java Tutorials
Java Import Statement Cleanup 2002-06-18 The Java Specialists' Newsletter [Issue 051] - Java Import Statement Cleanup Author: Dr. Cay S. Horstmann... to receive training in Design Patterns. Java Import Statement Cleanup 

JSP Servlet Questions

error at programming
error at programming  import javax.servlet.http.*; import javax.servlet.*; import java.io.*; import java.sql.*; public class Login extends... =DriverManager.getConnection("Jdbc:Odbc:mydsn"); Statement s =c.createStatement 

JSP Servlet Questions

error at programming
error at programming  import javax.servlet.http.*; import javax.servlet.*; import java.io.*; import java.sql.*; public class Login extends... =DriverManager.getConnection("Jdbc:Odbc:mydsn"); Statement s =c.createStatement 

JSP Servlet Questions

error at programming
error at programming  import javax.servlet.http.*; import javax.servlet.*; import java.io.*; import java.sql.*; public class Login extends... =DriverManager.getConnection("Jdbc:Odbc:mydsn"); Statement s =c.createStatement 

JSP Servlet Questions

error at programming
error at programming  import javax.servlet.http.*; import javax.servlet.*; import java.io.*; import java.sql.*; public class Login extends... =DriverManager.getConnection("Jdbc:Odbc:mydsn"); Statement s =c.createStatement 

JSP Servlet Questions

error at programming
error at programming  import javax.servlet.http.*; import javax.servlet.*; import java.io.*; import java.sql.*; public class Login extends... =DriverManager.getConnection("Jdbc:Odbc:mydsn"); Statement s =c.createStatement 

JSP Servlet Questions

error at programming
error at programming  import javax.servlet.http.*; import javax.servlet.*; import java.io.*; import java.sql.*; public class Login extends... =DriverManager.getConnection("Jdbc:Odbc:mydsn"); Statement s =c.createStatement 

DMCA.com