41. Which of these package is used for text formatting in Java programming language?
42. What will be the output of the following Java program?
import java.text.*;
import java.util.*;
class Date_formatting
{
public static void main(String args[])
{
Date date = new Date();
SimpleDateFormat sdf;
sdf = new SimpleDateFormat("mm:hh:ss");
System.out.print(sdf.format(date));
}
}
Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).
import java.text.*;
import java.util.*;
class Date_formatting
{
public static void main(String args[])
{
Date date = new Date();
SimpleDateFormat sdf;
sdf = new SimpleDateFormat("mm:hh:ss");
System.out.print(sdf.format(date));
}
}
Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).
43. Which of this class can be used to format dates and times?
44. Which of these class allows us to define our own formatting pattern for dates and time?
45. Which of these formatting strings of SimpleDateFormat class is used to print week of the year?
46. Which of the following matches nonword character using regular expression in java?
47. What will be the output of the following Java program?
import java.text.*;
import java.util.*;
class Date_formatting
{
public static void main(String args[])
{
Date date = new Date();
SimpleDateFormat sdf;
sdf = new SimpleDateFormat("z");
System.out.print(sdf.format(date));
}
}
Note : The program is executed at 3 hour 55 minutes and 4 sec on Monday, 15 July(24 hours time).
import java.text.*;
import java.util.*;
class Date_formatting
{
public static void main(String args[])
{
Date date = new Date();
SimpleDateFormat sdf;
sdf = new SimpleDateFormat("z");
System.out.print(sdf.format(date));
}
}
Note : The program is executed at 3 hour 55 minutes and 4 sec on Monday, 15 July(24 hours time).