Education Menu


Features Menu


Additional Menu


Now Online

We have 80 guests online



Follow US

Twitter You Tube Google Plus
Pinterest Facebook EduLanka Blog


Information Zone

eduLanka Sinhala

Welcome to eduLanka.LK, Largest online education web site in Sri Lanka & most popular educational web site among Sri Lankan students. EduLanka, Best nonprofit & educational website is provided large numbers of online lessons, education related course information, teachers information, E books, examination result alerts, goverment job alerts, tuition class information, career guide for school leavers and more resources related to education in Sri Lanka. Edulanka provides education related resources from primary education, O-Level & A-Level education, University & Postgraduate education and vocational training education.

EduLanka IDN Domains http://එඩියුලංකා.ලංකා http://எடியுலங்கா.இலங்கை

jobs Mathematics SLAS Exam Dharma Education Results


Inside Online School

Share Us

Home Page University Lessons Bachalor of Science - Physical Science (B.Sc. )

Java Linear Search - Sample Code
Wednesday, 24 August 2011 21:36

University of Ruhuna - Physical Science - Computer Science - Java Education

Linear Search Sample code:

Linear search is very very basic seaching algorithm and most used in education sector.

import TerminalIO.*;
class LinearSearch
public static void main(String arg[])
int i,nums;
int numArray[]={5,10,22,32,45,67,73,98,99,101};
KeyboardReader reader=new KeyboardReader( );
int item,location;

System.out.print("\nEnter the item you are searching for : ");

if (location> -1)
System.out.println("The item is at location "+location);

System.out.println("The item is not in the list");

public static int linearsearch(int list[],int key)
//include the body of this method




Add comment

Add comments relevant to this Article. මෙම ලිපියට අදාලව පමණක් අදහස් එකතු කරන්න.

Security code


Download Toolbar


Most Popular Articles

Latest Articles

Copyright © 2005 - 2016 (ඉස්කෝලේ) eduLanka Online Education School of Sri Lanka