logo

CuriousTab

CuriousTab

Discussion


Home Certification Oracle Certification See What Others Are Saying!
  • Question
  • In the following pieces of code, B and D will compile without any error. True or false ? A: StringBuffer sb1 = "abcd"; B: Boolean b = new Boolean("abcd"); C: byte b = 255; D: int x = 0x1234; E: float fl = 1.2;


  • Options
  • A. TRUE
  • B. FALSE

  • Correct Answer
  • TRUE 

    Explanation

    The code segments B and D will compile without any error. A is not a valid way to construct a StringBuffer, you need to create a StringBuffer object using "new". B is a valid construction of a Boolean (any string other than "true" or "false" to the Boolean constructor will result in a Boolean with a value of "false"). C will fail to compile because the valid range for a byte is -128 to +127 (i.e., 8 bits, signed). D is correct, 0x1234 is the hexadecimal representation in java. E fails to compile because the compiler interprets 1.2 as a double being assigned to a float (down-casting), which is not valid. You either need an explicit cast, as in "(float)1.2" or "1.2f", to indicate a float.

  • Tags: Analyst, IT Trainer, Project Manager

    More questions

    • 1. Which two descriptions are correct about characteristics of IPv6 unicast addressing? (Choose two) A. Global addresses start with 2000::/3. B. Link-local addresses start with FF00::/10. C. Link-local addresses start with FE00:/12. D. There is only one loopback address and it is ::1.
    • Discuss
    • 2. What are the six OSPF route types?
    • Discuss
    • 3. How many non- overlapping channels are available with 802.11b?

    • Options
    • A. 3
    • B. 12
    • C. 23
    • D. 40
    • Discuss
    • 4. Which IEEE committee has been sanctioned by WAP and is called WPA2?
    • Discuss
    • 5. When a station sends a transmission to the MAC address ff : ff : ff : ff : ff : ff, what type of transmission is it?

    • Options
    • A. Unicast
    • B. Multicast
    • C. Anycast
    • D. Broadcast
    • Discuss
    • 6. In the operation of CSMA/CD, which host(s) have priority after the expiration of the backoff algorithm?

    • Options
    • A. All hosts have equal priority
    • B. The two hosts that caused the collision will have equal priority
    • C. The host that sent the jam signal after the collision
    • D. The host with the highest MAC address
    • Discuss
    • 7. What is the Classs A Private IP address space?
    • Discuss
    • 8. What is the Class C private IP address space?
    • Discuss
    • 9. To use VLSM, what capability must the routing protocols in use possess?

    • Options
    • A. Support for multicast
    • B. Multi-protocol support
    • C. Transmission of subnet mask information
    • D. Support for unequal load balancing
    • Discuss
    • 10. If you wanted administrators to see a message when logging into the router, which command would you use?

    • Options
    • A. message banner motd
    • B. banner message motd
    • C. banner motd
    • D. message motd
    • Discuss


    Comments

    There are no comments.

Enter a new Comment