100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
PRO192 Chapter 6 Questions and Answers 2024 €8,99   In winkelwagen

Tentamen (uitwerkingen)

PRO192 Chapter 6 Questions and Answers 2024

 4 keer bekeken  0 keer verkocht
  • Vak
  • Instelling

PRO192 Chapter 6 Questions and Answers 2024 Consider this class: 1. public class Test1 { 2. public float aMethod(float a, float b) { 3. } 4. 5. } Which of the following methods would be legal if added (individually) at line 4? (Choose all that apply.) A. public int aMethod(int a, int b) ...

[Meer zien]

Voorbeeld 2 van de 6  pagina's

  • 11 augustus 2024
  • 6
  • 2024/2025
  • Tentamen (uitwerkingen)
  • Vragen en antwoorden
avatar-seller
PRO192 Chapter 6

Consider this class:
1. public class Test1 {
2. public float aMethod(float a, float b) {
3. }
4.
5. }
Which of the following methods would be legal if added (individually) at line 4? (Choose
all
that apply.)
A. public int aMethod(int a, int b) { }
B. public float aMethod(float a, float b) { }
C. public float aMethod(float a, float b, int c) throws Exception { }
D. public float aMethod(float c, float d) { }
E. private float aMethod(int a, int b, int c) { } ** Answ** a,c,e

Consider these classes, defined in separate source files:
1. public class Test1 {
2. public float aMethod(float a, float b)
3. throws IOException {...
4. }
5. }
1. public class Test2 extends Test1 {
2.
3. }
Which of the following methods would be legal (individually) at line 2 in class Test2?
(Choose
all that apply.)
A. float aMethod(float a, float b) {...}
B. public int aMethod(int a, int b) throws Exception {...}
C. public float aMethod(float a, float b) throws Exception {...}
D. public float aMethod(float p, float q) {...} ** Answ** b,d

You have been given a design document for a veterinary registration system for
implementation
in Java. It states:
"A pet has an owner, a registration date, and a vaccination-due date. A cat is a pet that
has a
flag indicating whether it has been neutered, and a textual description of its markings."
Given that the Pet class has already been defined, which of the following fields would
be
appropriate for inclusion in the Cat class as members? (Choose all that apply.)
A. Pet thePet;

, B. Date registered;
C. Date vaccinationDue;
D. Cat theCat;
E. boolean neutered;
F. String markings; ** Answ** e,f

You have been given a design document for a veterinary registration system for
implementation
in Java. It states:
"A pet has an owner, a registration date, and a vaccination-due date. A cat is a pet that
has a
flag indicating if it has been neutered, and a textual description of its markings."
Given that the Pet class has already been defined and you expect the Cat class to be
used freely
throughout the application, how would you make the opening declaration of the Cat
class, up
to but not including the first opening brace? Use only these words and spaces: boolean,
Cat,
class, Date, extends, Object, Owner, Pet, private, protected, public, String.
A. protected class Cat extends Owner
B. public class Cat extends Object
C. public class Cat extends Pet
D. private class Cat extends Pet ** Answ** c

Consider the following classes, declared in separate source files:
1. public class Base {
2. public void method(int i) {
3. System.out.print("Value is " + i);
4. }
5. }
1. public class Sub extends Base {
2. public void method(int j) {
3. System.out.print("This value is " + j);
4. }
5. public void method(String s) {
6. System.out.print("I was passed " + s);
7. }
8. public static void main(String args[]) {
9. Base b1 = new Base();
10. Base b2 = new Sub();
11. b1.method(5);
12. b2.method(6);
13. }
14. }
What output results when the main method of the class Sub is run?
A. Value is 5Value is 6

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

√  	Verzekerd van kwaliteit door reviews

√ Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, Bancontact of creditcard voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper smartchoices. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €8,99. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 81849 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€8,99
  • (0)
  Kopen