- Trending Categories
- 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
Maruthi Krishna has Published 951 Articles
Maruthi Krishna
10K+ Views
The Boolean class of the lang package provides two method namely parseBoolean() and valueOf().parseBoolean(String s) − This method accepts a String variable and returns boolean. If the given string value is "true" (irrespective of its case) this method returns true else, if it is null or, false or, any other ... Read More
Maruthi Krishna
792 Views
Using the Runtime classJava provides a class named java.lang.Runtime, using this class you can interface with the current environment.The getRunTime() (static) method of this class returns a Runtime object associated with the current application.The exec() method accepts a String value representing the command to execute a process in the current ... Read More
Maruthi Krishna
5K+ Views
Using the parseDouble() methodThe parseDouble() method of the java.lang.Double class accepts a String value, parses it, and returns the double value of the given String.If you pass a null value to this method, it throws a NullPointerException and if this method is not able to parse the given string into ... Read More
Maruthi Krishna
271 Views
The URL class of the java.net package represents a Uniform Resource Locator which is used to point a resource (file or, directory or a reference) in the world wide web.The openStream() method of this class opens a connection to the URL represented by the current object and returns an InputStream ... Read More
Maruthi Krishna
11K+ Views
You can read the contents of a web page in several ways using Java. Here, we are going to discuss three of them.Using the openStream() methodThe URL class of the java.net package represents a Uniform Resource Locator which is used to point a resource (file or, directory or a reference) ... Read More
Maruthi Krishna
14K+ Views
You can find whether the given String contains specified character in the following ways −Using the indexOf() methodYou can search for a particular letter in a string using the indexOf() method of the String class. This method returns an integer parameter which is a position index of a word within ... Read More
Maruthi Krishna
5K+ Views
Any whole number which is greater than 1 and has only two factors that is 1 and the number itself, is called a prime number. Other than these two number it has no positive divisor. For example: 7 = 1 × 7Following is the algorithm to find whether a number ... Read More
Maruthi Krishna
8K+ Views
The filed named out of the System class represents a standard output Stream, an object of the PrintStream class.The println() method of this accepts any a value ( of any Java valid type), prints it and terminates the line.By default, console (screen) is the standard output Stream (System.in) in Java ... Read More
Maruthi Krishna
1K+ Views
Assume we have a folder named ExampleDirectory in the directory D with 7 files and 2 directories as −Where, SampleDirectory1 contains two files named SampleFile1.txt and SampleFile2.txt.SampleDirectory2 contains two files named SampleFile2.txt and SampleFile3.txt.ExampleFollowing Java example deletes all the files in the directory named ExampleDirectory.import java.io.File; import java.io.IOException; public class ... Read More
Maruthi Krishna
4K+ Views
Assume we have a folder named ExampleDirectory in the directory D with 7 files and 2 directories as −Where, SampleDirectory1 contains two files named SampleFile1.txt and SampleFile2.txt.SampleDirectory2 contains two files named SampleFile2.txt and SampleFile3.txt.ExampleFollowing Java example lists the names of all the files in the directory named ExampleDirectory.import java.io.File; import ... Read More