100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSE 110 Final Questions and Correct Answers $10.09   Add to cart

Exam (elaborations)

CSE 110 Final Questions and Correct Answers

 10 views  0 purchase
  • Course
  • CSE
  • Institution
  • CSE

Which reserved word in Java is used to create an instance of a class ~~ new The relationship between a class and an object is best described as... ~~ objects are instances of classes Which of the following would not be considered an algorithm? pseudocode, shopping list, recipe, computer progra...

[Show more]

Preview 2 out of 14  pages

  • August 9, 2024
  • 14
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSE
  • CSE
avatar-seller
TestTrackers
CSE 110 Final Questions and
Correct Answers

What are the indexes for the first and last positions of an array called x?


✓✓~~ x[0] and x[x.length-1]




Immediately after instantiating a new array of primitives, what fills the array? What

about an array of objects?


✓✓~~ Primitive: default value fills the array (0 for int, 0.0 for double, false for boolean)




Objects: null fills array




What happens when you try to access an array element past the end of an array?


✓✓~~ An exception of type ArrayIndexOutOfBoundsException is thrown




Instantiate three arrays called x,y,and z of types int, String, and BankAccount,

respectively, all of size 10.


✓✓~~ int[] x = new int[10];
String[] y = new String[10];

BankAccount[] z = new BankAccount[10];

, What is method overloading?


✓✓~~ two methods in the same class that have the same name but different signatures (ex:
int calc(double n1, int n2) and int calc(int 1, int n2))




Use the following full array x:{4,8,5,1,6,3,2}




a. What is the value given by x[1]?

b. What is the value given by x[6]?

c. What is the value given by x[7]?

d. What is the value given by x.length?


✓✓~~ a. 8
b. 2

c. ArrayIndexOutOfBounds

d. 7




Write a for-loop to double each element in the array x given in the aray

x:{4,8,5,1,6,3,2}


✓✓~~ for(int i = 0; i<x.length; i++) {
x[i] *= 2;

}




What is a static variable?

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller TestTrackers. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.09. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

80796 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.09
  • (0)
  Add to cart