- Telekom mobilszolgáltatások
- Megjött a jubileumi Pixel széria
- Milyen okostelefont vegyek?
- Az iPhone hajthatatlanságán gúnyolódik a Samsung
- One mobilszolgáltatások
- Samsung Galaxy S22 és S22+ - a kis vagány meg a bátyja
- Mobil flották
- iPhone topik
- Okosóra és okoskiegészítő topik
- Hivatalos a OnePlus 13 startdátuma
Ú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?:))
- Kínai és egyéb olcsó órák topikja
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- Telekom mobilszolgáltatások
- VR topik (Oculus Rift, stb.)
- Világelső, 321 cellarétegű QLC-s 3D NAND-ot hozott az SK Hynix
- 5.1, 7.1 és gamer fejhallgatók
- Kerékpárosok, bringások ide!
- Villanyszerelés
- Autós topik
- Azonnali alaplapos kérdések órája
- További aktív témák...
- Új MSI Katana 15 Gamer FHD IPS 144Hz i7-13620H 10mag 16GB 512GB Nvidia RTX 4060 8GB Win11 Garancia
- ÁRGARANCIA!Épített KomPhone i5 10400F 16/32GB RAM RX 7600 8GB GAMER PC termékbeszámítással
- GYÖNYÖRŰ iPhone 13 256GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS3205
- BESZÁMÍTÁS! MSI MAG 325CQRXF QHD VA 240Hz 1ms monitor garanciával hibátlan működéssel
- Honor MagicBook 16 Ryzen 5 5600H 16GB 256GB FHD 144Hz
Állásajánlatok
Cég: FOTC
Város: Budapest