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

1. Java Web Start is a technology that can be used to deploy Java applications.

ID: 3559667 • Letter: 1

Question

1.

Java Web Start is a technology that can be used to deploy Java applications.

A) True
B) False

2.

Which of the following Java 2D methods would be the best to used to draw circles?

A) drawRect( ..... )
B) drawLine( ..... )
C) draw3DRect( ..... )
D) drawOval( ..... )

3.

Which of the following is not a potential problem with concurrency?

A) starvation
B) deadlock
C) reading data from objects that are read/write
D) reading data from objects that are read only

4.

Which of the following is not a valid thread state?

A) switch
B) ready
C) running
D) terminated

5.

A generic class enables you to specify, with one method declaration, a set of related methods.

A) True
B) False

6.

Java only suuport ".wav" files for audio

A) True
B) False

8.

Structured Query Language (SQL) is used to create statements to retrieve information from a database.

A) True
B) False

9.

The Java DB/Apache Derby database can be run in either a stand-alone (i.e. network accessible) or embedded mode.

A) True
B) False

10.

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

11.

Mutator methods change a value and accessor methods retrieve a value.

A) True
B) False

12.

A method declared static can access non-static class members

A) True
B) False

13.

Applets execute on the client-side within an applet container.

A) True
B) False

14.

The Java 2D API provides advanced two-dimensional graphics capabilities.

A) True
B) False

15.

Java supports multiple inheritance.

A) True
B) False

16.

Boxing converts a primitive value to an object of the corresponding type wrapper.

A) True
B) False

17.

Which method is used by a server to wait for a connection from a client?

A) getOutputStream ( .... )
B) getInputStream ( .... )
C) accept ( .... )
D) serverSocket ( ... )

18.

Which SQL statement is used to add new records to a database table?

A) INSERT
B) UPDATE
C) DELETE
D) SELECT

19.

An IP address is composed of a series of 3 integer values ranging from 0 to 255, each separated by a period. For example the following is a valid IP address.

192.1.168

A) True
B) False

20.

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

21.

For generics, a type-parameter name can be declared multiple times in the type-parameter section.

A) True
B) False

22.

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.

23.

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

24.

A collection is an object that can only store primitie type data (e.g., int, double, char, etc.).

A) True
B) False

25.

Which of the following is the meth0d called when an applet is first loaded?

A) construct
B) destroy
C) init
D) start

26.

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.

27.

A circle is a closed shape composed of straight line segments

A) True
B) False

28.

Consider the abstract superclass below.

public abstract class Foo
{
     private int a;
     public int b;
    
     public Foo( int aVal, int bVal )
    {
          a = aVal;
          b = bVal;
     }

     public abstract int calculate( );
}

Any concrete subclass that inherits from class Foo

A) Must implement a method called calculate()
B) Will not be able to access the instance variable a
C) Will not be able to instantiate an object of class Foo
D) All other answers are correct

29.

The @Override annotation can be used to assist the compiler in identifying certain types of mistakes that are not syntax errors.

A) True
B) False

30.

In Object Oriented programming classes encapsulate

A) Data and Methods
B) compilers and interpreters
C) overriding and semicolons
D) debuggers

31.

A URL is used to identify a resource on the Internet.

A) True
B) False

32.

Applets must contain a constructor that has the same name as the class.

A) True
B) False

33.

Inheritance can be described as an "is-a" relationship

A) True
B) False

34.

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.

Explanation / Answer

1. A TRUE

2. D) drawOval( ..... )

3. C) reading data from objects that are read/write

4. A) switch

5. A) True

6. B) FALSE

8. A) TRUE

9. A) TRUE

10. B) Double

11.A) True

12. B) FALSE

13. A) True

14 A) TRUE

15. B)- FALSE

16. A) True

17. C) accept ( .... )

18. A) INSERT

19. B) FALSE

20. A) Hashmap

21. A) True

22. B) for an overridden constructor, the superclass constructor will always be called first.

23. D) port

24. B) FALSE

25. C) init

26. D) A reference to class A can be treated as a reference to class B

27. A) TRUE

28. D) All other answers are correct

29. A) True

30. A) Data and Methods

31. A) True

32. B) FALSE

33. A) True

34. C) a and b are declared as a primitive data type.