0% found this document useful (0 votes)
33 views2 pages

Marka Model Operativensistem Goleminanamemorija: Public Class Public Public Private Private Int

The document defines a Telefon class with properties for brand, model, operating system, and memory size. Getter and setter methods are included to access and modify the property values. The main method instantiates a Telefon object, sets the property values, and prints them out.

Uploaded by

Chetelev Dimitar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

Marka Model Operativensistem Goleminanamemorija: Public Class Public Public Private Private Int

The document defines a Telefon class with properties for brand, model, operating system, and memory size. Getter and setter methods are included to access and modify the property values. The main method instantiates a Telefon object, sets the property values, and prints them out.

Uploaded by

Chetelev Dimitar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

public class Telefon {

public String marka;


public String model;
private String operativenSistem;
private int goleminaNaMemorija;

public Telefon()
{
marka=" ";
model=" ";
operativenSistem=" ";
goleminaNaMemorija=0;
}
public String getMarka()
{
return marka;
}
public String getModel()
{
return model;
}
public String getOperativenSistem()
{
return operativenSistem;
}
public int getGoleminaNaMemorija()
{
return goleminaNaMemorija;
}
public void setMarka(String marka)
{
this.marka=marka;
}
public void setModel(String model)
{
this.model=model;
}
public void setOperativenSistem(String operativenSistem)
{
this.operativenSistem=operativenSistem;
}
public void setGoleminaNaMemorija(int goleminaNaMemorija)
{
this.goleminaNaMemorija=goleminaNaMemorija;
}
}

public class TelefonGlavna {public static void main(String[] args) {


Telefon tn=new Telefon();
tn.marka="Audi";
tn.model="A6";
tn.setOperativenSistem("Windows");
tn.setGoleminaNaMemorija(6);
System.out.println("Marka: "+tn.marka);
System.out.println("Model: "+tn.model);
System.out.println("Operativen Sistem: "+tn.getOperativenSistem());
System.out.println("Memorija: "+tn.getGoleminaNaMemorija()+"GB");
}
}

You might also like