Home Answers Viewqa Java-Beginners i am unable to identify the error in my code

 
 


nagavellisony
i am unable to identify the error in my code
1 Answer(s)      11 months ago
Posted in : Java Beginners

class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter a character"); char ch=(char)br.read(); System.out.println("the entered character is:"+ch); }

}

View Answers

May 30, 2012 at 12:40 PM


Your code needs to import java.io.* package. Moreover, it also requires try catch block as it may throw exception. Anyways, we have modified your code. Here its is:

import java.io.*;

class Program { 
    public static void main(String[] args) {
        try{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); 
        System.out.println("enter a character");
        char ch=(char)br.read();
        System.out.println("the entered character is:"+ch);
        }
        catch(Exception e){}
        }

}









Related Pages:
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
can i know the error in this code... am unable to run this code
can i know the error in this code... am unable to run this code  ...}; int n=arr.lenght; System.out.println("length of array:"+n); for(int i=0;i System.out.println(arr[i]); } }   You have used incorrect symbol in your
unable to connect database in java
unable to connect database in java  Hello Everyone! i was trying to connect database with my application by using java but i am unable to connect...();} And i am getting this error java.sql.SQLException: [Microsoft][ODBC
unable to connect database in java
unable to connect database in java  Hello Everyone! i was trying to connect database with my application by using java but i am unable to connect...){e.printStackTrace();} And i am getting this error java.sql.SQLException
this is my javascript code and i am not understanding the mistake in this,please help me?
this is my javascript code and i am not understanding the mistake in this,please help me?  <html> <h2>Form Validation</h2> <script language = "Javascript"> function checkEmail
Unable to compile class for JSP - WebSevices
: Unable to compile class for JSP When I am trying to access a java file kept under src folder under a package from a jsp page placed under web directory, I am getting above error. Java code in src folder is accepting webservice output
unable to get datas from oracle database
unable to get datas from oracle database  Dear Sir, I am again struck in my project.. i want to display data from oracle database but i get this error when i run the jsp file in tomcat, I post my code below.. kindly let me
unable to see the output of applet. - Applet
unable to see the output of applet.  Sir, I was going through... presume to be some image i am not able to see. is there anything wrong with my browser? please provide me with a solution .. i want to see the output
Problem in my code - Development process
Problem in my code  Plz go thru this code. I want to check login and pwd with database. Backend MsAccess , Table name : Reg , Dsn Name: JJ While executing code am getting 404 error User Name Password
Unable to bind to a hashmap from jsp using spring tags - Spring
Unable to bind to a hashmap from jsp using spring tags  Hi, I am unable to bind a hashmap from my jsp page. Here is what i want to do: I have... i am unable to bind it and i am getting
error
"+it); } } this is my program i am getting an error saying cannot find symbol class string... inside the method 'accept()'. Here is your modified code: import java.util.
Unable to send mail using php script
Unable to send mail using php script  Hello i am trying to send mail... server which i run in background before executing the code.and my php.ini file... ; For Win32 only. ;sendmail_from = me@example.com I have this php code can
Unable to find Software Updates in Help menu in MyEclipse
Unable to find Software Updates in Help menu in MyEclipse  Hi, I am using MyEclipse for my project. I have to use SVN repository for checking the code and need to install Subclipse plugins to MyEclipse. But I am not getting
Unable to understand Struts - Struts
Unable to understand Struts  I am studying in GNIIT from NIIT. Here in 4th sem we have stuts also but I am not able to understand it. I've made... if a servlet-specific error occurs * @throws IOException if an I/O error
ERROR with my JAVA code - Java Beginners
ERROR with my JAVA code  The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix this....it is really stressing me out!! HELP!!! import java.awt.*; import
unable to run servlet
unable to run servlet  Dear sir/madam i have jdk1.5.0_04 and tomcat server 1.0.16 installed on my computer. on my computer servlet is compiling...: http://localhost:8080/webdir/servlet/helloworld. it giving error like : HTTP
Unable to call .jrxml file from jsp
then it unable to access it.Error also not showing. I will show my code and its output...Unable to call .jrxml file from jsp  Hi, I am doing web application in jsp. To create report I have used ireport and interated with neatbeans using
Error in Code - Development process
Error in Code  Hi; This is my code to get all d records from View_Service table but am getting error. I just copied this from net.I am doing mini project plz send me code to get records. What action should i mention
Unable to install Subversion plugins in MyEclipse
reply Deepak. I am using MyEclipse Blue Edition 8.6 M1. I tried adding Subversion plugins and got error. This is the path i followed: Help --> MyEclipse Configuration center --> Sofware I took screenshots of the error and have
Am i convetrting the code right ? - Java Beginners
Am i convetrting the code right ?  C# private void button... (IOException ex) { }// i also tried the code below// try... a led on it. The LED blinks on the C#'s code. I think the code i have written
I am trying to create domains for column attributes of my data dictionary?
I am trying to create domains for column attributes of my data dictionary?  Please provide me with the best possible solution. I already have the fields and there data types in a table and then the field values in another table
unable to connect to server - JSP-Servlet
unable to connect to server  thank you for the program code for inserting and reteriving the image but i am unable to deploy these two programs in weblogic/apache servers can any one help me how to do this ?   Hi Friend
I am not able to display the selected value of my combobox
I am not able to display the selected value of my combobox   <... units order by unitcode"; $rsrcResult = mysql_query($strQuery); $i=1..._assoc($rsrcResult)) { $strA = $arrayRow[$i]; $strB = $arrayRow
I am getting error org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'IS_AUTHENTICATED_ANONYMOUSLY' is defined - Spring
I am getting error org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'IS_AUTHENTICATED_ANONYMOUSLY' is defined  Hello, I am getting error
:( I am not getting Problem (RMI)
I am not getting Problem (RMI)  When i am excuting RMI EXAMPLE 3,2 I am getting error daying nested exception and Connect Exception  
when sending the mail from java I am getting the below error - JavaMail
when sending the mail from java I am getting the below error   when sending the mail from java I am getting the below error : Exception...}} at java.net.URLClassLoader.findClass(libgcj.so.7rh) Code
My Sql Error - Development process
My Sql Error  Hello Sir ,I have Created Table with following Query,then Table Created Succefully,But some errors Occured, can u give me the Code...,Its Very Very Urgent. Thank u very Much for urs Great Support in My
unable to execute the examples
unable to execute the examples  unable to execute the examples given for struts,ejb,or spring tutorials.Please help I am a beginner
i am inserting an image into database but it is showing relative path not absolute path
i am inserting an image into database but it is showing relative path not absolute path   hi my first page......... Image Enter your name..."); } catch(Exception e) { System.out.println(e); } %> when i compiled it i
i am inserting an image into database but it is showing relative path not absolute path
i am inserting an image into database but it is showing relative path not absolute path   hi my first page......... Image Enter your name..."); } catch(Exception e) { System.out.println(e); } %> when i compiled it i
i am inserting an image into database but it is showing relative path not absolute path
i am inserting an image into database but it is showing relative path not absolute path   hi my first page......... <html> <head>...) { System.out.println(e); } %> </body> </html> when i compiled it i
java script unable to connect to oracle database and insert data
;Hello Everyone, I am new to jsp and servers.. my first project given to me... to run the jsp file from tomcat i get this error.. let me know what i am doing... to start my project, i am struggled in this. insert.jsp <%@page import
unable to retrive the data from mysql using servlet using jdbc driver
(request,response); } } .i am unable to redirect..here is the code..pls...unable to retrive the data from mysql using servlet using jdbc driver  Hi, i have a servlet program..to verify the login and redirect to correct
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern = /^\d{3,5
pls review my code - Struts
pls review my code  Hello friends, This is the code in struts. when i click on the submit button. It is showing the blank page. Pls respond soon...("error in connecting database"); } return null
pls review my code - Struts
pls review my code  When i click on the submit page i am getting a blank page Pls help me. thanks in advance. public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request
Syntax error in my UPDATE..please advise
Syntax error in my UPDATE..please advise  Hi experts, I tested my code and NetBean IDE gave me the following message:- You have an error...; stmt.executeUpdate(sql); Please advise how should I change my SQL to use Heidi MySQL
unable to display image using html tag in servlet.(image src is in a variable.....). i am using netbeans IDE. plz..........do help
unable to display image using html tag in servlet.(image src is in a variable.....). i am using netbeans IDE. plz..........do help  import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException
my answer
-specific error occurs * @throws IOException if an I/O error occurs */ protected... ServletException if a servlet-specific error occurs * @throws IOException if an I/O... * @throws IOException if an I/O error occurs */ @Override protected
Unable to execute JSP page
Unable to execute JSP page  I have written one jsp file. It contains html tags and jsp directives. I have saved the file with the extension .jsp. The tomcat server is already running onto my machine. I have saved the jsp file
error in code - JDBC
error in code  hi friends i had one problem when i am running the application of jdbc code it is getting that Exception in thread "main" java.lang.NoSuchMethodError: main plz send me the solution for that error   
query in simple code..i had described all...........
query in simple code..i had described all...........  SAME HERE...[]) { B b1=new B(); b1.callmetoo(); } } WHEN I AM COMPILING javac AbstractDemo.java,I receives en error: AbstractDemo.java:5:cannot find symbol symbol: class B
Unable to compile Servlet
Unable to compile Servlet  First I installed the tomcat server in C...\servlet-api.jar Then I created my servlet file Servlet_LifeCycle.java under... was created by me. To compile my servlet program I did the following: C:\apache
how can i simplify my java code
how can i simplify my java code  /* Create a program that prompts... Scanner (System.in); String pass=""; int c = 1; int code=0... c=0;int f=0;int i=0; int counter=0; int starter=0; int cot=1
I/O Program output error
I/O Program output error  Hello All, I am working on a program... file, but I am getting incorrect output. I have been successfull with part... in advance for any help. Here is the code I have come up with so far: print
Error in servlets
Error in servlets  I cant execute my servlet or jsp programs. Im getting an error resource not found. I am using tomcat 6.0. I have set the path and class path correctly. My code is also correct. I have done everything but i

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.