can i know the error in this code... am unable to run this code

Ads
 

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]);
        }
    }
}

Ads









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
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
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
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
can i Execute PHP code inside python script?
can i Execute PHP code inside python script?    can i Execute PHP code inside python script
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
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
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
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
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
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
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
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
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
My Base Class is Changing every time in my code. How I can overcome this?
My Base Class is Changing every time in my code. How I can overcome this?  I have had the below question asked in interview, i'm curious to learn the answer. I have a base class, 'GeneratorBaseClass' that is extended
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
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
Please can I get the code for solution of producer consumer problem using semaphores?
Please can I get the code for solution of producer consumer problem using semaphores?  Please can I get the code for solution of producer consumer...; } public void run(){ int i = 0; while (true
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
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
Java Code Color Function Error
Java Code Color Function Error  Java Code Color Function Error
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
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
code
code  i have four textboxes.whenever i click on up,down,left or down arrows then the cursor move to another textbox based on the key pressed.i want code for this in javascript
getting error in your login form code
getting error in your login form code  i tried your code for login form but i am getting an error.the error is undefined index userid and password.the code is $fuser=$POST["userid"];. how to solve this problem please help me

Ads