logo

CuriousTab

CuriousTab

Discussion


Home Certification Oracle Certification Comments

  • 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

    Oracle Certification problems


    Search Results


    • 1. What is the output after compile and run the following code ? int Output = 10; boolean b = false; if((b == true) && ((Output += 10) == 20)) { System.out.println("We are equal " + Output); } else { System.out.println("Not equal! " + Output); }

    • Options
    • A. Compilation and output of "We are equal 10"
    • B. Compilation and output of "Not equal! 10"
    • C. Compilation error, attempting to perform binary comparison on logical data type
    • D. Compilation and output of "Not equal! 20"
    • Discuss
    • 2. Why do you need common fields in a Database?
    • Discuss
    • 3. Difference between Candidate key and Primary key?
    • Discuss
    • 4. What is the maximum number of triggers, can apply to a single table?

    • Options
    • A. 8
    • B. 10
    • C. 12
    • D. 14
    • Discuss
    • 5. Which dml command is used in conjunction with @@identity?

    • Options
    • A. INSERT and UPDATE
    • B. UPDATE and DELETE
    • C. SCOPE_IDENTITY and IDENT_CURRENT
    • D. Commit and rollback
    • Discuss
    • 6. Define Executive Plan in Database SQL ?
    • Discuss
    • 7. Insert command falls in which sub-language of SQL ?

    • Options
    • A. DCL
    • B. DQL
    • C. DML
    • D. DDL
    • Discuss
    • 8. In R-DBMS, the data is organized in the form of _____.

    • Options
    • A. Hierarchical structure
    • B. Tabular structure
    • C. Linked structure
    • D. All of the above
    • Discuss
    • 9. What are the different types of SQL statements ?
    • Discuss
    • 10. How many joining conditions are required to join 4 tables in SQL?

    • Options
    • A. 1
    • B. 2
    • C. 3
    • D. 4
    • Discuss


    Comments

    There are no comments.

Enter a new Comment