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);
}
}
- If the following is put in line 6,
Middleclass middleclassObject = new Middleclass();
what would be displayed?
- 53
- 8
- 5
- 35
- 3
| import java.util.*; public class Invoice { public static void main(String [] args) { GregorianCalendar now = new GregorianCalendar(); System.out.println(now.get(GregorianCalendar.MONTH)); } } |
- If it is currently February, what will be displayed as a result of the code on the right?
- 1
- Feb
- 2
- 0
- February
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
