![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
Found 9326 Articles for Object Oriented Programming
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
471 Views
To format the message with date in Java, we use the MessageFormat class and the Date class. The MessageFormat class gives us a way to produce concatenated messages which are not dependent on the language. The MessageFormat class extends the Serializable and Cloneable interfaces.Declaration - The java.text.MessageFormat class is declared as follows −public class MessageFormat extends FormatThe MessageFormat.format(pattern, params) method formats the message and fills in the missing parts using the objects in the params array matching up the argument numbers and the array indices.The format method has two arguments, a pattern and an array of arguments. The pattern contains placeholder ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
169 Views
To format message with percentage fillers in Java, we use the MessageFormat class. The MessageFormat class gives us a way to produce concatenated messages which are not dependent on the language. The MessageFormat class extends the Serializable and Cloneable interfaces.Declaration - The java.text.MessageFormat class is declared as follows −public class MessageFormat extends FormatThe MessageFormat.format(pattern, params) method formats the message and fills in the missing parts using the objects in the params array matching up the argument numbers and the array indices.The format method has two arguments, a pattern and an array of arguments. The pattern contains placeholder in {} curly ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
215 Views
To format message with integer fillers in Java, we use the MessageFormat class. The MessageFormat class gives us a way to produce concatenated messages which are not dependent on the language. The MessageFormat class extends the Serializable and Cloneable interfaces.Declaration − The java.text.MessageFormat class is declared as follows −public class MessageFormat extends FormatThe MessageFormat.format(pattern, params) method formats the message and fills in the missing parts using the objects in the params array matching up the argument numbers and the array indices.The format method has two arguments, a pattern and an array of arguments. The pattern contains placeholder in {} curly ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
766 Views
To substitute tokens in a String in Java, we use the Message Format class. The Message Format class provides a means to produce concatenated messages which are not dependent on the language. The Message Format class extends the Serializable and Cloneable interfaces.Declaration − The java.text.MessageFormat class is declared as follows −public class MessageFormat extends FormatThe MessageFormat.format(pattern, params) method formats the message and fills in the missing parts using the objects in the params array matching up the argument numbers and the array indices.The format method has two arguments, a pattern and an array of arguments. The pattern contains placeholder in ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
947 Views
In order to set the base time zone to GMT in Java, we use the setRawOffset(int offsetMillis) method. The java.util.TimeZone.setRawOffset(int offsetMillis) method set the base timezone offset to GMT.Declaration − The java.util.TimeZone.setRawOffset(int offsetMillis) method is declared as follows −public abstract void setRawOffset(int offsetMillis)where offsetMillis is the given base time zone offset to GMT.Let us set the base timezone offset to GMT in Java −Example Live Demoimport java.util.*; public class Example { public static void main( String args[] ) { // creating default object of TimeZone TimeZone obj = TimeZone.getDefault(); System.out.println("Default timezone ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
4K+ Views
In order to get the ID of this timezone in Java, we use the getDisplayName() method. The getDisplayName() returns a name of this time zone acceptable for display to the user in the default locale. In other words, the name returned by the getDisplayName() is user friendly.Declaration − The java.util.TimeZone.getDisplayName() is declared as follows −public final String getDisplayName()Let us see a program to get the ID of this timezone in Java −Example Live Demoimport java.util.*; public class Example { public static void main( String args[] ) { // creating default object of TimeZone TimeZone ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
2K+ Views
In order to get the default Time Zone in Java, we use the getDefault() method. The java.util.TimeZone.getDefault() method returns the default TimeZone for the particular host. The source of the default TimeZone varies with the implementation.Declaration −The java.util.TimeZone.getDefault() method is declared as follows −public static TimeZone getDefault()Let us see a program to get the default time zone in Java −Example Live Demoimport java.util.*; public class Example { public static void main( String args[] ) { // creating default object of TimeZone TimeZone obj = TimeZone.getDefault(); System.out.println("Default timezone object: " + obj); ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
178 Views
In order to get the IDs according to the given time zone offset in Java, we use the getAvailableIDs(int rawOffset) method. The java.util.TimeZone.getAvailableIDs(int rawOffset) method returns the available IDs according to the given time zone offset in the arguments.Declaration − The java.util.TimeZone.getAvailableIDs(int rawOffset) method is declared as follows −public static String[] getAvailableIDs(int rawOffset)where rawOffset is the given time zone GMT offset.Let us see a Java program which gets the IDs according to the given time zone offset −Example Live Demoimport java.util.*; public class Example { public static void main(String args[]) { // getting available supported ids for ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
5K+ Views
To get all the IDs of the TimeZone in Java, we use the getAvailableIDs() method. The getAvailableIDs() method returns all the available IDs which are compatible.Declaration −The java.util.TimeZone.getAvailableIDs() method is declared as follows −public static String[] getAvailableIDs()Let us see a Java program which gets all the IDs of the Time Zone:Example Live Demoimport java.util.*; public class Example { public static void main(String args[]) { // getting available supported ids String[] id = TimeZone.getAvailableIDs(); // printing available ids System.out.println("The available IDs are as follows:"); for (int ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
12K+ Views
In order to compute maximum element of ArrayList with Java Collections, we use the Collections.max() method. The java.util.Collections.max() returns the maximum element of the given collection. All elements must be mutually comparable and implement the comparable interface. They shouldn’t throw a ClassCastException.Declaration −The Collections.max() method is declared as follows −public static T max(Collection c)where c is the collection object whose maximum is to be found.Let us see a program to find the maximum element of ArrayList with Java collections −Example Live Demoimport java.util.*; public class Example { public static void main (String[] args) { List list ... Read More