66.
How to convert a String to a Date object?

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd");
sdf.parse(new Date());

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd");
sdf.format(new Date());

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd");
new Date().parse();

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd");
new Date().format();

68.
What will be the error in the following Java code?
byte b = 50;
b = b * 50;

70.
What will be the output of the following Java code?
class increment {
    public static void main(String args[]) 
    {        
         int g = 3;
         System.out.print(++g * 8);
    } 
}

Read More Section(Data Types and Variables)

Each Section contains maximum 100 MCQs question on Data Types and Variables. To get more questions visit other sections.