Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

PRO192 Chap 4 Questions and Answers 2024

Beoordeling
-
Verkocht
-
Pagina's
5
Cijfer
A+
Geüpload op
11-08-2024
Geschreven in
2024/2025

PRO192 Chap 4 Questions and Answers 2024 Which of the following statements is correct? (Choose one.) A. Only primitives are converted automatically; to change the type of an object reference, you have to do a cast. B. Only object references are converted automatically; to change the type of a primitive, you have to do a cast. C. Arithmetic promotion of object references requires explicit casting. D. Both primitives and object references can be both converted and cast. E. Casting of numeric types may require a runtime check. ** Answ** d

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

PRO192 Chap 4 Questions and Answers 2024

Which of the following statements is correct? (Choose one.)
A. Only primitives are converted automatically; to change the type of an object
reference, you
have to do a cast.
B. Only object references are converted automatically; to change the type of a primitive,
you
have to do a cast.
C. Arithmetic promotion of object references requires explicit casting.
D. Both primitives and object references can be both converted and cast.
E. Casting of numeric types may require a runtime check. ** Answ** d

Which one line in the following code will not compile?
1. byte b = 5;
2. char c = '5';
3. short s = 55;
4. int i = 555;
5. float f = 555.5f;
6. b = s;
7. i = c;
8. if (f > b)
9. f = i;
A. Line 1
B. Line 2
C. Line 3
D. Line 4
E. Line 5
F. Line 6
G. Line 7
H. Line 8
I. Line 9 ** Answ** f

Will the following code compile?
1. byte b = 2;
2. byte b1 = 3;
3. b = b * b1;
A. Yes
B. No ** Answ** b

In the following code, what are the possible types for variable result? (Choose the most
complete
true answer.)

, 1. byte b = 11;
2. short s = 13;
3. result = b * ++s;
A. byte, short, int, long, float, double
B. boolean, byte, short, char, int, long, float, double
C. byte, short, char, int, long, float, double
D. byte, short, char
E. int, long, float, double ** Answ** e

Consider the following class:
1. class Cruncher {
2. void crunch(int i) {
3. System.out.println("int version");
4. }
5. void crunch(String s) {
6. System.out.println("String version");
7. }
8.
9. public static void main(String args[]) {
10. Cruncher crun = new Cruncher();
11. char ch = 'p';
12. crun.crunch(ch);
13. }
14. }
Which of the following statements is true? (Choose one.)
A. Line 5 will not compile, because void methods cannot be overridden.
B. Line 12 will not compile, because no version of crunch() takes a char argument.
C. The code will compile but will throw an exception at line 12.
D. The code will compile and produce the following output: int version.
E. The code will compile and produce the following output: String version. ** Answ**
d

Which of the following statements is true? (Choose one.)
A. Object references can be converted in assignments but not in method calls.
B. Object references can be converted in method calls but not in assignments.
C. Object references can be converted in both method calls and assignments, but the
rules
governing these conversions are very different.
D. Object references can be converted in both method calls and assignments, and the
rules
governing these conversions are identical.
E. Object references can never be converted. ** Answ** d

Consider the following code. Which line will not compile?
1. Object ob = new Object();
2. String[] stringarr = new String[50];

Geschreven voor

Vak

Documentinformatie

Geüpload op
11 augustus 2024
Aantal pagina's
5
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$9.69
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
smartchoices Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
36
Lid sinds
5 jaar
Aantal volgers
5
Documenten
4499
Laatst verkocht
1 maand geleden

4.8

9 beoordelingen

5
7
4
2
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen