- 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
4K+ Views
To display number in scientific notation, create NumberFormat object first −NumberFormat numFormat = newDecimalFormat();Now, let’s say you need to format the minimum value of Integer −int i = Integer.MIN_VALUE; System.out.println(i); numFormat = newDecimalFormat("0.######E0"); System.out.println(numFormat.format(i)); numFormat = newDecimalFormat("0.#####E0"); System.out.println(numFormat.format(i));Above, we have used format() method of the NumberFormat class.Example Live Demoimport java.text.DecimalFormat; import ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
436 Views
You can use the concept of IFNULL() for this. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(100) DEFAULT 'Larry', Age int DEFAULT NULL ); Query OK, 0 rows affected (0.73 sec)Insert records in the table ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
107 Views
A view of the ByteBuffer can be created as a FloatBuffer using the asFloatBuffer() method in the class java.nio.ByteBuffer. This method requires no parameters and it returns a float buffer as required. This buffer reflects the changes made to the original buffer and vice versa.A program that demonstrates this is ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
484 Views
Let’s say the following is our string with integer and characters −String str = "(29, 12; 29, ) (45, 67; 78, 80)";Now, to extract integers, we will be using the following pattern −\dWe have set it with Pattern class −Matcher matcher = Pattern.compile("\d+").matcher(str);Example Live Demoimport java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
124 Views
You can use modify command for this. Let us first us create a table.mysql> create table DemoTable ( StudentId varchar(200) not null, StudentName varchar(20), StudentAge int, StudentAddress varchar(20), StudentCountryName varchar(20) ); Query OK, 0 rows affected (0.73 sec)Now check the description of table.mysql> desc DemoTable;This ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
4K+ Views
This is a C++ program for getting a subvector from a vector in C++AlgorithmBegin Declare s as vector s(vector const &v, int m, int n) to initialize start and end position of vector to constructor. auto first = v.begin() + m. ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
86 Views
The equality of two buffers can be checked using the method equals() in the class java.nio.CharBuffer. Two buffers are equal if they have the same type of elements, the same number of elements and the same sequence of elements. The method equals() returns true if the buffers are equal and ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
77 Views
Let’s say our file is “input.txt”, which is set read-only −File myFile = new File("input.txt"); myFile.createNewFile(); myFile.setReadOnly();Now, set the above file to writable −myFile.setWritable(true);After that, you can use canWrite() to check whether the file is writable or not.Example Live Demoimport java.io.File; public class Demo { public static void main(String[] args) ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
743 Views
A file can be set to read-only by using the method java.io.File.setReadOnly(). This method requires no parameters and it returns true if the file is set to read-only and false otherwise. The method java.io.File.canWrite() is used to check whether the file can be written to in Java and if not, ... Read More