I need help for the java homework, could you help me? DbMS: Rules for Primary Ke
ID: 3840639 • Letter: I
Question
I need help for the java homework, could you help me?
DbMS: Rules for Primary Key: i. Must be unique ii. Must be valued iii. Can have duplicate values iv. Can have null values a. i only b. i and ii c. iii and iv d. i and iv That is the annotation required for JUnit test methods? b. @Before b. @After c. @Test d. @TestMethod What will be printed with the following code? Integer a = now Integer(4); Integer b = new Integer(8); Integer c = new Integer(4); HashSet hs = new HashSet(); hs.add(a); hs.add(b); hs.add(c); System.out.println(hs); a. Will print [4, 8] b. Will print [4, 4, 8] c. Will print [4, 8, 4] A new value/member can be added to an enum at runtime? a. True b. False An enum has a constructor method. Can it be called with the 'new' keyword (can you create an instance of an enum? a. Yes b. No Consider the following code: public enum Day {SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY} The value for WEDNESDAY is: a. 0 b. 1 c. 2 d. 3Explanation / Answer
Answer is B. Primary key must be unique which means that values should not be replicated. and it must contain a value which means that primary key cannot be null Answer is C. Junit testing should be started with @test annotation Answer is C. Will Print {4,8,4} since the output statement asked to print hs and hs reads in the order a,b,c. So the order of prinitng will be 4,8,4 No. A new value cannot be added to enum at runtime since it is a static one. No. In enum a constructor cannot be called using a new keyword . The value of wednesday will be 3 since we will start counting from 0 for sunday.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.