- 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
3K+ Views
Abstract classA class which contains 0 or more abstract methods is known as abstract class. If it contains at least one abstract method, it must be declared abstract.If you want to use the concrete method in an abstract class you need to inherit the class, provide implementation to the abstract ... Read More
Maruthi Krishna
1K+ Views
In general, while reading or writing data to a file, you can only read or, write data from the start of the file. you cannot read/write from random position.The java.io.RandomAccessFile class in Java enables you to read/write data to a random access file.This acts similar to a large array of ... Read More
Maruthi Krishna
5K+ Views
Once you write a Java program you need to compile it using the javac command, this shows you the compile time errors occurred (if any).Once you resolve them and compile your program success fully, an executable file with the same name as your class name is generated in your current ... Read More
Maruthi Krishna
16K+ Views
API’s usedThe replaceAll() method of the String class accepts two strings representing a regular expression and a replacement String and replaces the matched values with given String.The java.util class (constructor) accepts a File, InputStream, Path and, String objects, reads all the primitive data types and Strings (from the given source) ... Read More
Maruthi Krishna
477 Views
The split() method of the String class. splits the current string around matches of the given regular expression. The array returned by this method contains each substring of this string that is terminated by another substring that matches the given expression or is terminated by the end of the string.The ... Read More
Maruthi Krishna
13K+ Views
The java.text package provides a class named SimpleDateFormat which is used to format and parse dates in required manner (local).One of the constructors of this class accepts a String value representing the desired date format and constructors SimpleDateFormat object.The format() method of this class accepts a java.util.Date object and returns ... Read More
Maruthi Krishna
1K+ Views
Using regular expressionYou can find whether a particular String value contains ASCII characters using the following regular expression −\A\p{ASCII}*\zThe matches() method of the String class accepts a regular expression and verifies whether the current string matches the given expression if so, it returns true, else it returns false.Therefore, Invoke the ... Read More
Maruthi Krishna
4K+ Views
You can initialize the array variable which is declared inside the class just like any other value, either using constructor or, using the setter method.ExampleIn the following Java example, we are declaring an instance variable of array type and initializing it from the constructor. Live Demopublic class Student { String ... Read More
Maruthi Krishna
615 Views
There are various methods in Java using which you can parse for words in a string for a specific word. Here we are going to discuss 3 of them.The contains() methodThe contains() method of the String class accepts a sequence of characters value and verifies whether it exists in the ... Read More
Maruthi Krishna
656 Views
We can compare Strings in Java in various ways −Using the comapareTo() method − The compareTo() method compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence ... Read More