×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Manikanth Mani
has Published
71
Answers
Java Program to remove all white spaces from a String.
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 12-Feb-2018 10:52:29
The replaceAll() method of the String class replaces each substring of this string that matches the given regular expression with the given replacement. You can remove white spaces from a string by replacing " " with "".Example Live Demopublic class DuplicateCharacters { public static void main(String[] args){ ...
Read More
How to convert int to String in java?
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 12-Feb-2018 10:17:35
You can convert a String value to an integer either using the valueOf() method of the String class or using the toString() method of the Integer class.
What is the difference between StringBuffer and StringBuilder in java?
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 09-Feb-2018 17:34:51
The StringBuffer and StringBuilder classes are used when there is a necessity to make a lot of modifications to Strings of characters.Unlike Strings, objects of type StringBuffer and String builder can be modified over and over again without leaving behind a lot of new unused objects.The StringBuilder class was introduced as of ...
Read More
Java String equals() method.
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 09-Feb-2018 17:21:02
The equals() method compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.Example Live Demopublic class Sample{ public static void main(String []args){ ...
Read More
How to use equals() and equalsIgnoreCase() in Java.
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 09-Feb-2018 17:09:19
The equals() methodThis method compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.Exampleimport java.lang.*; public class StringDemo { public static void main(String[] args) ...
Read More
concat(), replace(), and trim() Strings in Java.
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 09-Feb-2018 16:57:45
The concat() method of the String class appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method.Examplepublic class Test { public static void main(String ...
Read More
The Optimum Method to Concatenate Strings in Java.
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 09-Feb-2018 15:07:14
The Optimum Method to Concatenate Strings in Java is the concat() method.This method appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method.ExampleLive Demopublic class ...
Read More
Java String concat() method
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 09-Feb-2018 14:16:30
The concat() method of the String class appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method.Examplepublic class Test { public static void main(String ...
Read More
Manipulating Strings in Java.
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 09-Feb-2018 12:51:30
Since String class is immutable once created we cannot modify the data of the string. But still if you want to manipulate string data you can rely on StringBuffer or StringBuilder classes.Examplepublic class Test { public static void main(String args[]) { String str = "Hi welcome ...
Read More
How do I time a method execution in Java
Java 8
Object Oriented Programming
Programming
Manikanth Mani
Published on 06-Feb-2018 17:30:45
You should get a start time before making a call and end time after method execution. The difference is the time taken. ExampleLive Demoimport java.util.Calendar; public class Tester { public static void main(String[] args) { long startTime = Calendar.getInstance().getTimeInMillis(); longRunningMethod(); long ...
Read More
Previous
1
2
3
4
5
6
7
8
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout