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

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 Tutorials/Questions & Answers:
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
Advertisements
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 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
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
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
this is my code but i cant able to run it wt is the problem
this is my code but i cant able to run it wt is the problem  import java.io.*; class createthread { int thread=4,i; class thread1 extends createthread { public void run() { for(i=0;i
this is my code but i cant able to run it wt is the problem
this is my code but i cant able to run it wt is the problem  import java.io.*; class createthread { int thread=4,i; class thread1 extends createthread { public void run() { for(i=0;i
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
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
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
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
I want to know the all possible syntax for EL code to print the first element of an array.
I want to know the all possible syntax for EL code to print the first element of an array.  Which is the correct EL codes syntax to print the first element of an array named employeeArray. ${employeeArray["0"]} or ${employeeArray
run php code online
run php code online  Is it possible to run PHP Code online
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   
can i Execute PHP code inside python script?
can i Execute PHP code inside python script?    can i Execute PHP code inside python script
Java error code
Java error code       Java Error code are the set of error that occurs during the compile-time and Run-time. From java error we have given  you
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
How can i add a new count to this source code ? - Java Beginners
How can i add a new count to this source code ?  Hi everyone I...;ZHTYPE (Just Logical) Please tell me how can i see this output? Code... This output with this code is true but I want add ZHTYPE at the end of each line
How can i add a new count to this source code ? - Java Beginners
How can i add a new count to this source code ?  Hi everyone I...;ZHTYPE (Just Logical) Please tell me how can i see this output? Code... with this code is true but I want add ZHTYPE at the end of each line + XTSM/XTS please
how can i create a mysql database to connect to this code - JDBC
how can i create a mysql database to connect to this code  i need help creating a mysql database for this code. code is import java.awt....";, "root", "root"); Statement st=con.createStatement(); int i
how can i create a mysql database to connect to this code - JDBC
how can i create a mysql database to connect to this code  i need help creating a mysql database for this code. code is import java.awt....";, "root", "root"); Statement st=con.createStatement(); int i
Error in a code. - Java Beginners
Error in a code.  This is the question I posted yesterday: "I'm.... I'm confused about where and what i should put into the overall code. Also I can't... is pressed the program has to calculate the prime factors of the given number. I
How can i implement the calculator programe in jsp code
How can i implement the calculator programe in jsp code  Please send code for the calculator using jsp technologies please guidelines to me.   Here is a simple jsp calculator code that accepts two numbers from the user
Upload Code error on deploying
Upload Code error on deploying  on deploying the above code as it is said it is giving error that " No getter method for property thefile of bean org.apache.struts.taglib.html.BEAN " Error 500--Internal Server Error
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
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
i want code for these programs
i want code for these programs   Advances in operating system Laboratory Work: (The following programs can be executed on any... use of a bounded buffer (size can be prefixed at a suitable value
code error - JSP-Servlet
code error  hii this program is not working becoz when the mouse... is error in this progrm. ss function describe() { window.status... complaint   Hi friend, Do some changes in your code to solve
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
Code Error - WebSevices
Code Error  How to insert checkbox values to mysql using php  Hi friend, Code to help in solving the problem : Insert CheckBox Thanks
this code gives addition of 2 numbers in j2me..but the code is not executing ..can u pls find out the error...??
this code gives addition of 2 numbers in j2me..but the code is not executing ..can u pls find out the error...??  import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class add1 extends MIDlet implements
Snippet Code Error
Snippet Code Error  The following is a snippet of code from a Java application which uses Connector/J to query a MySQL database. Identify possible problems and possible solutions. Connection cn= DriverManager.getConnection
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
jsp code error - JSP-Servlet
there is the problem which i am facing.what will be the exact code for this..plz help me I appreciate the correct code...jsp code error  I have a jsp page named "tMastDepartment".which has
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
In JSP page, inside a javascript function, can I place a java code using scriptlet tag?
In JSP page, inside a javascript function, can I place a java code using... is trying to close a window, I am calling a java script function closeWind() in jsp page. In a separate java file, in a method checkListValue(), I am doing
jsp code error - Java Beginners
jsp code error  Hi, I have a problem with following code. the else part does not working properly. I want to display a message box in else part. Is it possible to display a message box or alert box in jsp code??. plz help
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
i need program or code for this program
i need program or code for this program  out should be in this form 1 2 3 4 5 6 3 5 7 9 11 8 12 16 20 20 28 36 48 64 112
i am getting an error in adding a menu item to a menu.
i am getting an error in adding a menu item to a menu.   i am not able to execute the menu program. i am getting an error at menu.add(menuitem); it says add method is undefined for type menu. but as far as i know that is only way
Java Code Color Function Error
Java Code Color Function Error  Java Code Color Function Error
Compilation error. Hibernate code - Hibernate
Compilation error. Hibernate code   Exception in thread "main...) how to rectify that error in hibernate  Hi Friend, You have to download the slf4j-api-1.6.0.jar file and set its path. You can download the jar file
one error but i dont know how to fix it o_O!!!
one error but i dont know how to fix it o_O!!!  where is the mistake here ?? import java.utill.Scanner; public class Time { public static void..."); } } the compilar told me that there is only one error... thx
jsp code error - JSP-Servlet
jsp code error  hello, is anyone here who can solve my problem. what happen experts where r u? r u not able to do
jsp code error - JSP-Servlet
jsp code error  hello, is anyone here who can solve my problem. what happen experts where r u? or u r not able to do
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server... must be connected with the server after that your message can broadcast to each
error in java code - Java Beginners
error in java code  Hi Can u say how to communication between systems in a network.   Hi friend, A method for controlling an operation of a server system by a client system interconnected with the server
Java code to run unix command - Java Beginners
Java code to run unix command  Hi, I need a java code to connect to a remote unix server and run a unix command. Please help. Regards, Pratyush

Ads