- 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
Anvi Jain has Published 634 Articles
Anvi Jain
147 Views
In order to reverse the sequence of characters in a StringBuffer Object, we use the reverse() method. The reverse() method replaces the character sequence with the reverse of its own.Declaration − The java.lang.StringBuffer.reverse method is declared as follows−public StringBuffer reverse()Let us see a program to reverse the sequence of characters ... Read More
Anvi Jain
20K+ Views
Before converting a String to UTF-8-bytes, let us have a look at UTF-8.UTF-8 is a variable width character encoding. UTF-8 has ability to be as condense as ASCII but can also contain any unicode characters with some increase in the size of the file. UTF stands for Unicode Transformation Format. ... Read More
Anvi Jain
753 Views
The java.lang.Math class has an abs() method which facilitates us to find the absolute values of different data types.Absolute value of floatIn order to compute the absolute value of a float value, we use the java.lang.Math.abs(float a) method. If the argument ‘a’ is negative, the negation of ‘a’ is returned. ... Read More
Anvi Jain
584 Views
Binary search on a char array can be implemented by using the method java.util.Arrays.binarySearch(). This method returns the index of the required char element if it is available in the array, otherwise, it returns (-(insertion point) - 1) where the insertion point is the position at which the element would ... Read More
Anvi Jain
379 Views
By default, assertions are disabled in Java. In order to enable them we use the following command −java -ea Example (or) java -enableassertions ExampleHere, Example is the name of the Java file.Let us see an example for generation of an assertion error by the JVM −Example Live Demopublic class Example { ... Read More
Anvi Jain
333 Views
In order to match the ZIP code using regular expression, we use the matches method in Java. The java.lang.String.matches() method returns a boolean value which depends on the matching of the String with the regular expression.Declaration − The java.lang.String.matches() method is declared as follows −public boolean matches(String regex)Let us see ... Read More
Anvi Jain
149 Views
Elements can be filled in a short array using the java.util.Arrays.fill() method. This method assigns the required short value to the short array in Java. The two parameters required are the array name and the value that is to be stored in the array elements.A program that demonstrates this is ... Read More
Anvi Jain
1K+ Views
In order to get the component type of an Array Object in Java, we use the getComponentType() method. The getComponentType() method returns the Class denoting the component type of an array. If the class is not an array class this method returns null.Declaration − The java.lang.Class.getComponentType() method is declared as ... Read More
Anvi Jain
53 Views
The getDeclaringClass() method returns the Class object for the class in which the object was declared. This happens only if the Class of the Class object is a member of another class. Otherwise this method returns null.Also, if a primitive type, array class, void etc. are represented by the Class ... Read More
Anvi Jain
2K+ Views
One of the methods the Timer class is void scheduleAtFixedRate(TimerTask task, Date firstTime, long period). This method schedules the specified task for repeated fixed-rate execution, beginning at the specified time.In fixed-rate execution, each execution is scheduled with respect to the scheduled run time of the initial execution. Fixed-rate execution is ... Read More
To Continue Learning Please Login
Login with Google