Home Answers Viewqa Java-Beginners can i know the error in this code... am unable to run this code

 
 


nagavellisony
can i know the error in this code... am unable to run this code
1 Answer(s)      a year ago
Posted in : Java Beginners

class DemoArray { public static void main(String args[]) { int arr[]={12,13,14,15}; int n=arr.lenght; System.out.println("length of array:"+n); for(int i=0;i

System.out.println(arr[i]);

} }

View Answers

May 30, 2012 at 2:54 PM


You have used incorrect symbol in your code like < >. The for is improper and not completed. Moreover, you have open and close braces properly. Anyways, we have modified your code. Here it is:

class DemoArray {
    public static void main(String args[]) {
        int arr[]={12,13,14,15}; 
        int n=arr.length; 
        System.out.println("length of array:"+n);
        for(int i=0;i<n;i++){ 
          System.out.println(arr[i]);
        }
    }
}









Related Pages:
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
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
Run this code..plzz - Java Beginners
Run this code..plzz  Hi Friend... ERROR: Exception in thread "main...;Hi friend, I am sending code according to your requirement but you...) ----------------------------------------------------------------- Can any one correct this Error
Code error
seconds) Hw can i correct this code????????   Basically, the Exception...) read.close(); } } } While using this it shows error as: run...Code error  package trail; import
I am new to java applets. When i run this code on applet viewer status is displayed that applet not initialized
I am new to java applets. When i run this code on applet viewer status is displayed that applet not initialized  import java.awt.*; import java.awt.event.*; import java.applet.*; public class Textfields extends Applet implements
Applet run with appletviewer but not in browser, any code problem.
());// error on bold line, please help me ASAP, because I am trying for three day's...Applet run with appletviewer but not in browser, any code problem.  Hi,My problem is when I am running my applet in appletviewer index.html, Its work
Run a simple EJB code
Run a simple EJB code  I found the code this. However, as I have no idea with EJB, I can't understand how to run it. Can anybody help me by giving steps (by giving snapshots or writing full procedure)how to run it (any platform
Run a simple EJB code
Run a simple EJB code  I found the code this. However, as I have no idea with EJB, I can't understand how to run it. Can anybody help me by giving steps (by giving snapshots or writing full procedure)how to run it (any platform
unable to run servlet
unable to run servlet  Dear sir/madam i have jdk1.5.0_04 and tomcat...: http://localhost:8080/webdir/servlet/helloworld. it giving error like : HTTP...-mapping> 6)Compile your servlet. 7)Run Tomcat server by clicking
unable to get datas from oracle database
this error when i run the jsp file in tomcat, I post my code below.. kindly let me know what i am wrong!! kindly help me in this. out.jsp <%@ page...unable to get datas from oracle database  Dear Sir, I am again
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 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
I am getting error.How can i get details
I am getting error.How can i get details  Exception in thread "main" java.sql.SQLException: Listener refused the connecti n with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect
code
I am not able to do so. Is it always necessary to do this when using function...code  Heris the javascript code.It works ffine but i would like to know what is the meaning of line this.SetData=SetData and next three lines after
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
How Jdbc program can be run??
to know what is the problem? and how can i run it successfully? please give me... ,but when i run it ,it gives following error-> C:\Program Files\Java...How Jdbc program can be run??  import java.sql.*; import java.util.
java run time error - Java Beginners
java run time error  when i compile my program it didnt show any error in my program.but i cant run my program, if i run my program means... any one can know what is the solution for this  Hi Friend
Jsp error when i run this a jsp file
Jsp error when i run this a jsp file  hi I got this error when i run the jsp file in IDE and outside also please help me...) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)   Please post your code
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
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 send mail using php script
Unable to send mail using php script  Hello i am trying to send mail... ; For Win32 only. ;sendmail_from = me@example.com I have this php code can... server which i run in background before executing the code.and my php.ini file
Run time error - WebSevices
Run time error  Hello, Anyone know, how run the template files in zend framework.Anybody help me. Rgds, Pras  code to help in solving the problem : protected function _run($template
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
Java code error - Java Beginners
Java code error  Hi, I am using a MooreQuery to look for neighbors...()){ ................................................. Even though I have the if (query != null), I still get a nullPointer exception from the query when trying to iterate , Can anyone help me
run time error
run time error  my program compile successfully but does not showing output for any program ...   Post your code.   public class... it doesn't showing any output. what should i do now?   Here it works
Unable to run jsp files on internet explorer - JSP-Servlet
Unable to run jsp files on internet explorer  Hi, I am Akhilesh Shrivastav. I am new to jsp and a new member of this site. My problem is i wrote...-tomcat-6.0.16/webapps/jsp i am sending simple program of jsp. Hello World JSP Page
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... this example. when i click on this link i go to the following link http
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   
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... seem to get that to work either. Can anyone offer some suggestions? I thank you
HOW TO RUN JDBC PRORAM ON JDK1.5.0
driver specified i want to know what is the problem? and how can i run... this program i am using jdk1.5.0`*print("code sample");*` I have created Dsn... then it compiled successfully ,but when i run it ,it gives following error->
java run time error in loading the driver - JDBC
java run time error in loading the driver  when i mrunning the program in oracle using type 4 driver it is giving the error as Error:jdbc.driver.OracleDriver the code was as follows: please suggest me how it can
Swing error in code
_ON_CLOSE); sc.setVisible(true); } } I am getting...Swing error in code  import java.rmi.*; import java.awt.*; import... Panel(new GridLayout(2,2)); SInterface i; public SClientsr
Can i write JavaScript code in AjaxResponse Code ?
Can i write JavaScript code in AjaxResponse Code ?  Hai Every Dynamic's We can't write JavaScript code in Ajax Response Code.Why because it takes...'s not working.rather than that i try to created on innerHtml document. here
java applet run time error - Applet
java applet run time error  Hi, Im new to java applet.please help me. i have create a MPEG movie player in applet. when i run that program it show the error that,"javax.media.NoPlayerException: Error instantiating class
code
code   hi I need help in creating a java code that reminds user on a particular date about their festival. i have no clue of how to do it.. am looking forward to seek help from you
JSP code
JSP code  I get an error when i execute the following code : <... the driver but still i am getting the error.....Environment problems ?? What i need... app only i am unable to connect the database.   I am using Eclipse
Unable to run the jsp page - JSP-Servlet
Unable to run the jsp page  Expert:Naga Hi, I need solution this program. In cart.jsp I printed the total amount of the products then the next... = document.getElementsByName('am'); for ( i = 0; i < input1.length; i++ ) { if ( input1
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... i am unable to bind it and i am getting...: 106: Please let me know where am i getting wrong
How to run? - Hibernate
How to run?  Hiiiiiiiiiiiii friend.. i am Magesh, doing MCA at Madurai in Tamilnadu. i know little bit about Jsp,Servlet.. But my... Hibernate code in my application?  Hi friend, Hinernate : Hibernate
java run time error - Java Beginners
java run time error  i am getting error "main" java.lang.NullPointerException" in my program, iam sending code actually motive of program... only, i have to display number of files and its last modified time ,i use
You know - Java Beginners
reply me how can i solve.. Thanks  Hi Ragini, I don't know php. Can u say me how to install and configure then i will try. I know the logic... then please write the code and send me. My query is I have three table Consigne
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
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
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 run time error - JDBC
jdbc run time error  i m creating the table using thin driver it is showing the following run time error: Exception in thread "main...) at Jdbc14.main(Jdbc14.java:6) THE CODE WHICH I HAVE WRITTEN
java run time error - JDBC
java run time error  when i m running for batch execution program in jdbc i m facing this kind of runtime error as Exception in thread "main...) at BatchUpdation.main(BatchUpdation.java:10) THE CODE WHICH I HAVE WRITTEN
java code to insert select at run time....????
java code to insert select at run time....????  java database code... the application Java Swing then Visit Here   You can also visit........ i ll try it out
i am confused here on what to write can some 1 help out here - Java Beginners
i am confused here on what to write can some 1 help out here  i don't quite understand how to code it so can some one help out
code - Java Beginners
code  hello sir i am doing project on java for that i want a program for deleting the files from recycle bin can you give me that code ... actually i written code like this.. but run time error is coming.. import java.io.