GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

A factory produces metal rods whose weights (in pounds) are…

A factory produces metal rods whose weights (in pounds) are independent and identically distributed random variables with mean μ = 5 and standard deviation σ = 0.2. The rods are packaged in boxes of 30. Show your work on the scratch paper answering Q16-Q17.

Read Details

A graduate-level statistics class surveyed 120 students on t…

A graduate-level statistics class surveyed 120 students on their knowledge of three software tools: R, Python, and MATLAB. 65 students know R 75 students know Python 50 students know MATLAB 30 students know both R and Python 25 students know both R and MATLAB 35 students know both Python and MATLAB 15 students know all three languages Show your work on the scratch paper when answering Q1-Q3.

Read Details

The Open/Closed Principle calls for adding new code/function…

The Open/Closed Principle calls for adding new code/functionality without modifying the existing code. What is the benefit from doing so?  

Read Details

What is the output of the code below? Explain the observed b…

What is the output of the code below? Explain the observed behavior in detail. Map a = new HashMap(); Map b = new HashMap(); a.put(“c”, 130); b.put(“c”, 130); System.out.println(a.get(“c”) == b.get(“c”)); // output:

Read Details

What is the output of the code below? Explain the observed b…

What is the output of the code below? Explain the observed behavior in detail. String s1 = “hello”; String s2 = “hello”; System.out.println( s1 == s2 ); // output:

Read Details

Why is deep inheritance problematic?

Why is deep inheritance problematic?

Read Details

What is the output of the following code?     class A {    …

What is the output of the following code?     class A {               void foo() {  System.out.println(“1”); }               public A() {  System.out.println(“2”); foo();    }     }     class B extends A {               public B() { System.out.println(“3”);  }               void foo() { System.out.println(“4”);  }     }      public class Client {               public static void main(String [] args) {                              new B();               }    }

Read Details

Assuming list is non-empty, does this code compile or not? E…

Assuming list is non-empty, does this code compile or not? Explain.   public void func(List list){       list.add(“Hello”);    }

Read Details

Given two objects a and b such that a.equals(b) is true. Sho…

Given two objects a and b such that a.equals(b) is true. Should a.hashCode() and b.hashCode() be also equal? Justify your answer. Yes No Justification:

Read Details

Given the class hierarchy below. Could the symmetry of equal…

Given the class hierarchy below. Could the symmetry of equals() be violated? If yes, provide client code that demonstrates that.   class A {   int x;   public A(int x) {this.x = x;}   public boolean equals(Object o) {        if (!(o instanceof A)) return false;        A a = (A)o;        return this.x == a.x;   }        } class B extends A {   int y;   public B(int x, int y) {super(x); this.y = y;}   public boolean equals(Object o) {        if (!(o instanceof B)) return false;        B b = (B)o;        return super.equals(o) && this.y == b.y;   } }                

Read Details

Posts pagination

Newer posts 1 … 26,430 26,431 26,432 26,433 26,434 … 82,089 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top