d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Composition Question
Add Reply New Topic New Poll
Member
Posts: 31,401
Joined: Mar 25 2009
Gold: 134.00
Dec 19 2018 11:49pm
Code
package com.company;

public class Monitor {
private String model;
private String manufacturer;
private int size;
private Resolution nativeResolution;

public Monitor(String model, String manufacturer, int size, Resolution nativeResolution) {
this.model = model;
this.manufacturer = manufacturer;
this.size = size;
this.nativeResolution = nativeResolution;
}



There's another class called "Resolution"
I'm not sure what this part of code does.


Code
private Resolution nativeResolution;
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 20 2018 12:14am
what is your question? it does the same thing the other lines do:

private String model;
private String manufacturer;
private int size;
Member
Posts: 31,401
Joined: Mar 25 2009
Gold: 134.00
Dec 20 2018 12:15am
Quote (carteblanche @ Dec 20 2018 02:14am)
what is your question? it does the same thing the other lines do:

private String model;
private String manufacturer;
private int size;


yeah except it uses a class instead of a primitive data type....w hich is what i was wondering about, but now i know....
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 20 2018 12:15am
Quote (ferf @ Dec 20 2018 01:15am)
yeah except it uses a class instead of a primitive data type....w hich is what i was wondering about, but now i know....


String is a class instead of a primitive data type, too
Member
Posts: 31,401
Joined: Mar 25 2009
Gold: 134.00
Dec 20 2018 12:16am
Quote (carteblanche @ Dec 20 2018 02:15am)
String is a class instead of a primitive data type, too


true
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll