- 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
Samual Sam has Published 2492 Articles
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
575 Views
The code you are using \1+ just removes consecutive occurrences only. You can use the below code.SELECT REPLACE_REGEXPR('(.)(?=.*\1)' IN '22331122' WITH '' OCCURRENCE ALL) FROM DUMMYThe output will come out to be “312”. This will remove all multiple occurrences and only last one will be kept.
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
413 Views
A try/catch block is placed around the code that might generate an exception. Code within a try/catch block is referred to as protected code, and the syntax for using try/catch looks like the following –Syntaxtry { // Protected code } catch (ExceptionName e1) { // Catch block }The ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
Serialization Java provides a mechanism, called object serialization where an object can be represented as a sequence of bytes that includes the object's data as well as information about the object's type and the types of data stored in the object.Exampleimport java.io.*; public class SerializeDemo { public static void ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
71 Views
It can be illustrated with the help of an example in which we are creating a stored generated column in the table named ‘triangle_stored’. As we know that stored generated column can be generated by using the keyword ‘stored’.Examplemysql> Create table triangle_stored(SideA DOUBLE, SideB DOUBLE, SideC DOUBLE AS (SQRT(SideA * ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
89 Views
The fill(int[] a, int val) method of the java.util.Arrays class assigns the specified int value to each element of the specified array of integers.Exampleimport java.util.Arrays; public class ArrayDemo { public static void main(String[] args) { int arr[] = new int[] {1, 6, 3, 2, 9}; ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
73 Views
The hashCode(int[]) method of the java.util.Arrays class returns a hash code based on the contents of the specified array. For any two non-null int arrays a and b such that Arrays.equals(a, b), it is also the case that Arrays.hashCode(a) == Arrays.hashCode(b).Exampleimport java.util.Arrays; public class ArrayDemo { public static void main(String[] ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
239 Views
You can access a plain text using the File class.ExampleLive Demoimport java.io.File; public class ReadFile { public static void main(String[] args) { File f = null; String str = "data.txt"; try { f = ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
191 Views
The java.io.File.mkdirs() creates the directory named by this abstract pathname, together with necessary and non-existent parent directories.ExampleLive Demoimport java.io.File; public class Main { public static void main(String[] args) { String directories = "D:\a\b\c\d "; File file = new File(directories); boolean ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
14K+ Views
You can access the private methods of a class using java reflection package.Step1 − Instantiate the Method class of the java.lang.reflect package by passing the method name of the method which is declared private.Step2 − Set the method accessible by passing value true to the setAccessible() method.Step3 − Finally, invoke ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
131 Views
To fix this issue, you need to add try/catch response to the code. When you don’t include an authorization header, it results in an error 401 from the server.try { CatalogService.CatalogChangeClient service = new CatalogService.CatalogChangeClient(); service.ClientCredentials.UserName.UserName = "username"; service.ClientCredentials.UserName.Password = "password"; ... Read More