- 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 952 Articles
Maruthi Krishna
2K+ Views
Using the StringBuffer class To add underscore before each capital letter in a String using StringBuffer − Create an empty StringBuffer object. The isUpperCase() method of Character class accepts a character and verifies whether it is in upper case, if so, this method returns true. Using this method, verify each character in the ... Read More
Maruthi Krishna
1K+ Views
In Java classes and interfaces related to each other are grouped under a package. Package is nothing but a directory storing classes and interfaces of a particular concept. For example, all the classes and interfaces related to input and output operations are stored in java.io package. Creating a Package You can group ... Read More
Maruthi Krishna
828 Views
An interface in Java is a specification of method prototypes. Whenever you need to guide the programmer or, make a contract specifying how the methods and fields of a type should be you can define an interface. To create an object of this type you need to implement this interface, provide ... Read More
Maruthi Krishna
26K+ Views
Using the Date classYou can create a Date object using the Date() constructor of java.util.Date constructor as shown in the following example. The object created using this constructor represents the current time.ExampleLive Demoimport java.util.Date; public class CreateDate { public static void main(String args[]) { ... Read More
Maruthi Krishna
27K+ Views
Using StringBufferCreate an empty String Buffer object.Traverse through the elements of the String array using loop.In the loop, append each element of the array to the StringBuffer object using the append() method.Finally convert the StringBuffer object to string using the toString() method.Examplepublic class ArrayOfStrings { public static void main(String ... Read More
Maruthi Krishna
33K+ Views
The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories.To get the list of all the existing files in a directory this class provides the files class provides list() (returns names) ... Read More
Maruthi Krishna
36K+ Views
You can get the current date in Java in various ways. Following are some of them −The constructor of Date classThe no-arg constructor of the java.util.Date class returns the Date object representing the current date and time, using this you can print the current date as shown below −ExampleLive Demoimport java.text.SimpleDateFormat; ... Read More
Maruthi Krishna
42K+ Views
JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc.There are several Java libraries available to handle JSON objects. Jackson is a simple java based library to serialize ... Read More
Maruthi Krishna
49K+ Views
In general, the elapsed time is the time from the starting point to ending point of an event. Following are various ways to find elapsed time in Java −The currentTimeMillis() method returns the current time in milliseconds. To find the elapsed time for a method you can get the difference ... Read More
Maruthi Krishna
49K+ Views
The toString() method of the StringBuilder class reruns String value of the current object. To convert a StringBuilder to String value simple invoke the toString() method on it.Instantiate the StringBuilder class.Append data to it using the append() method.Convert the StringBuilder to string using the toString() method.ExampleIn the following Java program ... Read More