- Xiaomi 15T Pro - a téma nincs lezárva
- Xiaomi 13 Pro - szerencsés szám
- Samsung Galaxy Watch5 Pro - kerek, de nem tekerek
- Akciófigyelő: 25 000 forintos ajándék jár a Xiaomi Pad 8 tabletek mellé
- Samsung Galaxy A36 5G - a középső testvér
- Milyen okostelefont vegyek?
- Fotók, videók mobillal
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- Xiaomi 17 Ultra - jó az optikája
- Yettel topik
Ú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?:))
- MSI MAG 256F Monitor FHD/IPS/180HZ (060)
- AOC 27G4XED FHD/IPS/180HZ (056)
- AOC 25G3ZM FHD/240HZ/0.5MS (055)
- Üzletből, Hp gyártói garanciával, HP EliteBook 840 G11 ultra 5-125u/16GBRAM/512GBSSD/HULLHD+ kijelző
- ÚJ Bontatlan Apple MacBook Neo 13" A18 Pro 8GB/256GB magyar billentyűzet 1 év Garancia Deák Térnél.
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


