Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

17. What is the main difference between an ArrayList and a Vector ? Which is better to use? 18. What is the difference between a

17. What is the main difference between an ArrayList and a Vector ? Which is better to use?

18. What is the difference between a while statement and a do statement?

19. What is the difference between checked and unchecked exceptions?

20. What are the different scopes for Java variables?

21. What access specifiers are available in Java?

22. Does garbage collection guarantee that a program will not run out of memory?

23. Why would one use a PrepartedStatement versus a Statement?

24. Read the following program:

public class test { public static void main(String [] args) { int x = 3; int y = 1; if (x = y) System.out.println("Not equal"); else System.out.println("Equal"); } }

Please choose the correct result from the choices below.

A. The output is ?Equal?

B. The output in ?Not Equal?

C. An error at " if (x = y)" causes compilation to fall.

D. The program executes but no output is show on console.

25. Review the following code, what is output?

public class EqualsTest { public static void main(String[] args) { String s1 = abc; String s2 = s1; String s5 = abc; String s3 = new String(abc); String s4 = new String(abc); System.out.println(== comparison : + (s1 == s5)); System.out.println(== comparison : + (s1 == s2)); System.out.println(Using equals method : + s1.equals(s2)); System.out.println(== comparison : + s3 == s4); System.out.println(Using equals method : + s3.equals(s4)); } }

26. What is the difference between instanceof and isInstance?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions