LinearSearch

From ggc

Jump to: navigation, search

01 /**
02  * All about my application here.
03  @author Jam Jenkins
04  */
05 public class LinearSearch
06 {
07   public static void main(String[] args)
08   {
09     int[] nums={365136714523, -261};
10     boolean lucky=true;
11     for(int i=0; i<nums.length; i++)
12     {
13       System.out.println("Looking at: "+nums[i]);
14       if(nums[i]==13)
15       {
16         lucky=false;
17         System.out.println("Bad Luck!!!!");
18       }
19 
20       System.out.println("Lucky is now "+lucky);
21     }
22     System.out.println("Finally, the stack is "+lucky);
23   }
24 }


Download/View LinearSearch.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter