![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 9326 Articles for Object Oriented Programming
![Nikitha N](https://www.tutorialspoint.com/assets/profiles/13558/profile/60_76068-1512713229.jpg)
3K+ Views
You can include Jar files to which you need to set the classpath in the eclipse project using build pathStep 1 − Right click on the project Select Build Path → Configure Build Path.Step 2 − Select libraries select Add External JARs… button.Step3 − Then browse through the folder where the required jar files exits, select them and press open.Selected jar files will be added to the Libraries. Finally, press OK.Now, if you open the Referenced libraries in the project you can observe the added jar file.
![Srinivas Gorla](https://www.tutorialspoint.com/assets/profiles/13556/profile/60_78057-1512712331.jpg)
5K+ Views
Follow the steps given below, to integrate Ant into Eclipse.Make sure that the build.xml is a part of your java project, and does not reside at a location that is external to the project.Enable Ant View by following Window > Show View > Other > Ant > Ant.Open Project Explorer, drag the build.xml into the Ant View.Your Ant view looks similar to –Clicking on the targets, build / clean / usage will run Ant with the target. Clicking "fax" will execute the default target - usage.The Ant Eclipse plugin also comes with a good editor for editing build.xml files. The ... Read More
![Abhinanda Shri](https://www.tutorialspoint.com/assets/profiles/13552/profile/60_73264-1512711555.jpg)
531 Views
ANT stands for Another Neat Tool. It is a Java-based build tool from Apache.Ant is used to simplify the mundane tasks such as compiling the code, packaging the binaries, deploying the binaries to the test server, testing the changes, copying the code from one location to another etc. It is an Operating System build and deployment tool that can be executed from the command line.
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
2K+ Views
Java provides the java.util.regex package for pattern matching with regular expressions. You can then search for a pattern in a Java string using classes and methods of this packages.Exampleimport java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexMatches { public static void main( String args[] ) { String line = "This order was placed for QT3000! OK?"; String pattern = "(.*)(\d+)(.*)"; Pattern r = Pattern.compile(pattern); Matcher m = r.matcher(line); if (m.find( )) { System.out.println("Found value: " + m.group(0)); ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
550 Views
To count the number of lines in a file Instantiate the FileInputStream class by passing an object of the required file as parameter to its constructor. Read the contents of the file to a byte array using the read() method of FileInputStream class. Instantiate a String class by passing the byte array obtained, as a parameter its constructor. Finally, find the length of the string. Example import java.io.File; import java.io.FileInputStream; public class NumberOfCharacters { public static void main(String args[]) throws Exception{ File file = new File("data"); FileInputStream ... Read More
![Ankitha Reddy](https://www.tutorialspoint.com/assets/profiles/13550/profile/60_73963-1512711511.jpg)
152 Views
"On a mean, a developer spends a considerable quantity of your time doing mundane tasks compiling the code, packaging the binaries, deploying the binaries to the checkserver, testing the changes," copying the code from one location to another. To automate and simplify these tasks we can use build tools like Ant, Maven, Gradle etc.
![Arushi](https://www.tutorialspoint.com/assets/profiles/13510/profile/60_55588-1512537391.jpg)
2K+ Views
To count the number of lines in a fileInstantiate the FileInputStream class by passing an object of the required file as parameter to its constructor.Read the contents of the file to a bytearray using the read() method of FileInputStream class.Instantiate a String class by passing the byte array obtained, as a parameter its constructor.Now, split the above string into an array of strings using the split() method by passing the regular expression of the new line as a parameter to this method.Now, find the length of the obtained array.Exampleimport java.io.File; import java.io.FileInputStream; public class NumberOfCharacters { public static void main(String args[]) throws Exception{ ... Read More
![Paul Richard](https://www.tutorialspoint.com/assets/profiles/13505/profile/60_52698-1512536733.jpg)
5K+ Views
Read the number of words in text fileCreate a FileInputStream object by passing the required file (object) as a parameter to its constructor.Read the contents of the file using the read() method into a byte array. Insatiate a String class by passing the byte array to its constructor.Using split() method read the words of the String to an array.Create an integer variable, initialize it with 0, int the for loop for each element of the string array increment the count.Exampleimport java.io.File; import java.io.FileInputStream; public class Sample { public static void main(String args[]) throws Exception{ int count =0; File ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
12K+ Views
To convert the contents of an ArrayList to a String, create a StringBuffer object append the contents of the ArrayList to it, finally convert the StringBuffer object to String using the toString() method. Example import java.util.ArrayList; public class String_ArrayList { public static void main(String args[]) { ArrayList al = new ArrayList(); al.add("Hello"); al.add("are"); al.add("you"); StringBuffer sb = new StringBuffer(); for (String s : al) { sb.append(s); sb.append(" "); } String str = sb.toString(); System.out.println(str); } } Output Hello are you