GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

What does the specify in the following statement? ArrayList…

What does the specify in the following statement? ArrayList list = new ArrayList();

Read Details

What does the following code display? public class RentalApp…

What does the following code display? public class RentalApp { public static void main(String[] args) { Rental r = new Rental(); r.setPersonCount(5); r.addPerson(); System.out.println(r.getPersonCount()); } } class Rental { private int personCount; public int getPersonCount() { return personCount; } public void setPersonCount(int numOfPersons) { this.personCount = numOfPersons; } public void addPerson() { personCount++; } }

Read Details

What will be the value of x[8] after the following code is e…

What will be the value of x[8] after the following code is executed? final int SUB = 12; int[] x = new int[SUB]; int y = 100; for(int i = 0; i < SUB; i++) {  x[i] = y;  y += 10; }

Read Details

Which method overloads the following method? public int pars…

Which method overloads the following method? public int parseNumber(String number) { ……. }

Read Details

Assuming that the following two methods are written inside a…

Assuming that the following two methods are written inside a class named test, what is the output of the following code? public static void main(String[] args) {   int a = 5;   int b = 9; callMethod(a,b); System.out.println(“a = “+a+”\nb = “+b); } public static void callMethod(int a, int b) {  a = a + 1;  b = b + 5;  System.out.println(“a = “+a+”\nb = “+b); }

Read Details

Given the following method, which of these method calls is v…

Given the following method, which of these method calls is valid? public static void showProduct(double num1, int num2) {   double product;   product = num1*num2;   System.out.println(“The product is ” + product); }

Read Details

When a local variable in an instance method has the same nam…

When a local variable in an instance method has the same name as an instance field, the instance field hides the local variable.

Read Details

If the following constructor is in the Employee class, what…

If the following constructor is in the Employee class, what other form of constructor, if any, is automatically provided? public Employee(String name, int salary) { ……. }

Read Details

In Java, you do not use the new operator when you use a(n) _…

In Java, you do not use the new operator when you use a(n) _____.

Read Details

Guaifenesin, which is used for its sedative effects during t…

Guaifenesin, which is used for its sedative effects during the preanesthetic period, is

Read Details

Posts pagination

Newer posts 1 … 35,708 35,709 35,710 35,711 35,712 … 85,569 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top