Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

=+ b. What was nominal GDP? Real GDP?

Answered: 1 week ago

Question

Please solve

Answered: 1 week ago