Question: public class TestQuestion { public static void main(String[] args) { } } public class Middleclass { private int second = 3; Middleclass() { second +=5;

\public class TestQuestion

{

public static void main(String[] args)

{

}

}

public class Middleclass

{

private int second = 3;

Middleclass()

{

second +=5;

System.out.println(second);

}

}

  1. If the following is put in line 6,

Middleclass middleclassObject = new Middleclass();

what would be displayed?

  1. 53
  2. 8
  3. 5
  4. 35
  5. 3

import java.util.*;

public class Invoice

{

public static void main(String [] args)

{

GregorianCalendar now = new GregorianCalendar();

System.out.println(now.get(GregorianCalendar.MONTH)); }

}

  1. If it is currently February, what will be displayed as a result of the code on the right?
  2. 1
  3. Feb
  4. 2
  5. 0
  6. February

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!