Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

execution of programms in java

View previous topic View next topic Go down

GMT + 3 Hours execution of programms in java

Post by Diya Sun May 29, 2011 4:47 pm

Dear Sir Most of the examples in the handouts do not compile on the command prompt. just a few examples in the start are executed. I have correctly set the path also. in-spite when a run any code it gives many errors. for example in the following code is there any error. iport java.util.*; public class ArrayListTest { public static void main(String [] args){ ArrayList a1=new ArrayList(); Student s1=new Student ("ali", 1); Student s2=new Student ("Saad", 2); Student s3=new Student ("raza", 3); al.add(s2); al.add(s3); if (b==true){ System.out.println("arraylist size::" +size); } else{ int size=al.size(); System.out.println("arraylist size:" +size); } for (int i=0;i
Diya
Diya
Monstars
Monstars

Taurus Goat
Posts : 364
Join date : 2011-02-08
Age : 33
Notworthy

Character sheet
Experience:
execution of programms in java Left_bar_bleue10/500execution of programms in java Empty_bar_bleue  (10/500)

Back to top Go down

GMT + 3 Hours Re: execution of programms in java

Post by Vuhelper Sun May 29, 2011 4:49 pm

Following are the errors in the posted code.



Code:
import java.util.*; /*Correct keyworkd is import */



public class ArrayListTest

{

public static void main(String [] args){

ArrayList a1=new ArrayList();

Student s1=new Student ("ali", 1);

Student s2=new Student ("Saad", 2);

Student s3=new Student ("raza", 3);

al.add(s2);

al.add(s3);

if (b==true){

System.out.println("arraylist size::" +size);}

else{
avatar
Vuhelper
Deep Bench
Deep Bench

Posts : 97
Join date : 2011-05-29

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum