- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Milyen okostelefont vegyek?
- iPhone topik
- Végre hivatalos, mikor lesz az S26 hivatalos
- Samsung Galaxy Watch4 és Watch4 Classic - próbawearzió
- Hivatalos a OnePlus 13 startdátuma
- Edge 70 Fusion: új renderek, több szín és részletek a specifikációt illetően
- A világ aktív okostelefonjainak negyede iPhone, ötöde Galaxy
- Okosóra és okoskiegészítő topik
- Honor 200 Pro - mobilportré
Új hozzászólás Aktív témák
-
Azazello-
senior tag
lehetseges e egy boolian validation es ha igen, akkor hogyan?
/**
* This is my Concert class it contains informations about year, location and are there any ticket left.
*
* @author ()
* @version (10/12/09)
*/
public class Concert
{
private int year;
private String location;
private boolean ticketsLeft;
//Fields
public Concert(int conYear, String lct,boolean ticketAv){
year=conYear;
//this next line of code will call the method that will validate the information that is has been imput by the user
setLocation(lct);
ticketsLeft=ticketAv;
}
public Concert(){
year=0;
location="";
ticketsLeft=false;
}
//accessors
public int getYear(){
return year;
}
public String getLocation(){
return location;
}
public boolean getTicketsLeft(){
return ticketsLeft;
}
//mutators
public void setYear(int conYear){
year =conYear;
}
public void setLocation(String lct){
// the next line of code validates that the user has typed in "brighton Hastings or London"
if(lct.equals ("Brighton") || lct.equals("Hastings") || lct.equals("London")){
location = lct;
}
else{
//the next line of code print out a message when "Brighton Hastings or London" hasn't been typed
System.out.println("Valid locations: Brighton, Hastings, London");
}
}
public void setTicketsLeft(boolean ticketAv){
ticketsLeft = ticketAv;
}
//the next method will print out the Concert details
public void printConcert(){
System.out.println("Location: "+location);
System.out.println("Year :"+year);
System.out.println("Tickets Left: "+ticketsLeft);
}
}
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- HP EliteDesk 800 G2 MT PC, I7-6700, 8GB DDR4, 120GB SSD, Nvidia Quadr 1GB VGA, Win 11, Számla, garan
- Seagate BarraCuda 3.5 4TB 5900rpm 64MB SATA3 (ST4000DM000) HDD, Számla, Garancia
- Acer Nitro XV240YPbmiiprx Gaming monitor, 24", IPS, 2 ms, 165Hz, 1920x1080, FreeSync, HDMI, DP
- Kingston FURY Beast RGB 64GB (2x32GB) DDR4 3200MHz
- Eladó újsuerű Creality Hi 3D nyomtató
- Csere-Beszámítás! Acer Nitro 5 AN515-57! I7 11800H / RTX 3050Ti / 16GB DDR4 / 512GB Nvme SSD!
- BESZÁMÍTÁS! Intel Core i5 9400F 6 mag 6 szál processzor garanciával hibátlan működéssel
- HP ProDesk 600 G4 i3-8100 16GB 512GB 1 év garancia
- BESZÁMÍTÁS! MSI B450M R5 5500 8GB DDR4 250GB SSD GTX 1050Ti 4GB Zalman S2 TG DeepCool 400W
- Új! AKRacing Premium Master gamer szék
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


