Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assuming the following class definition: class SampleClass { int a; int b; Anoth

ID: 3539779 • Letter: A

Question

Assuming the following class definition:

class SampleClass
{
     int a;
     int b;

     AnotherClass q;

     public void sampleMethod()
     {
          int c = 1;
       
         a = c * 7;
         b = 32 + c * a;
     }
}


Which of the following statements is true?

Consider the classes below, defined in the same file,

class A
{
     int a;
     public A( )
     {
          a = 7;
     }
}

class B extends A
{
     int b;
      public B( )
      {
           b = 8;
      }
}


Which of the statements below is not true?

Which of the following type-wrapper classes would be used to autobox a primitive type value of 5.24 ?



15. Which of the following is not a valid thread state? A) switch
B) ready
C) running
D) terminated

16. Applets must contain a constructor that has the same name as the class. A) True
B) False

17. Which of the following is the meth0d called when an applet is first loaded? A) construct
B) destroy
C) init
D) start

18. Applets execute on the client-side within an applet container. A) True
B) False

19. Structured Query Language (SQL) is used to create statements to retrieve information from a database. A) True
B) False

20. In Object Oriented programming classes encapsulate A) Data and Methods
B) compilers and interpreters
C) overriding and semicolons
D) debuggers

21. Boxing converts a primitive value to an object of the corresponding type wrapper. A) True
B) False

22. Java only suuport ".wav" files for audio A) True
B) False

23. Overriding a method differs from overloading a method because A) for an overloaded constructor, the superclass constructor will always be called first.
B) for an overridden constructor, the superclass constructor will always be called first.
C) overridden methods have the same signature.
D) overloaded methods have the same signature.

24.

Assuming the following class definition:

class SampleClass
{
     int a;
     int b;

     AnotherClass q;

     public void sampleMethod()
     {
          int c = 1;
       
         a = c * 7;
         b = 32 + c * a;
     }
}


Which of the following statements is true?

A) c is a reference.
B) a and b are local variables.
C) a and b are declared as a primitive data type.
D) q is declared as a primitive data type.

25. Which of the following is used to designate where a service will listen for a connection on a machine? A) stream
B) datagram
C) stack
D) port

26. The Java 2D API provides advanced two-dimensional graphics capabilities. A) True
B) False

27. A circle is a closed shape composed of straight line segments A) True
B) False

28. Java Web Start is a technology that can be used to deploy Java applications. A) True
B) False

29. Java supports multiple inheritance. A) True
B) False

30. Which of the following collection types is used to store elements that will be accessed via a key? A) Hashmap
B) Stack
C) Vector
D) ArrayList

31.

Consider the classes below, defined in the same file,

class A
{
     int a;
     public A( )
     {
          a = 7;
     }
}

class B extends A
{
     int b;
      public B( )
      {
           b = 8;
      }
}


Which of the statements below is not true?

A) Both variables a and b are instance variables.
B) After the constructor for class B is executed, the variable a will have the value 7.
C) After the constructor for class B is executed, the variable b will have the value 8.
D) A reference to class A can be treated as a reference to class B.

32. A generic class enables you to specify, with one method declaration, a set of related methods. A) True
B) False

33.

Which of the following type-wrapper classes would be used to autobox a primitive type value of 5.24 ?

A) Byte
B) Double
C) Float
D) Short

35. Which method is used by a server to wait for a connection from a client? A) getOutputStream ( .... )
B) getInputStream ( .... )
C) accept ( .... )
D) serverSocket ( ... )

Explanation / Answer


A) True

==================================================================

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote