Hirdetés
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Huawei Watch GT 6 és GT 6 Pro duplateszt
- Milyen okostelefont vegyek?
- Mobil flották
- Eddigi legjobb DxOMark helyezésével zárta 2025-öt a Vivo
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Samsung Galaxy A54 - türelemjáték
- Apple Watch Ultra - első nekifutás
- One mobilszolgáltatások
- Android alkalmazások - szoftver kibeszélő topik
Új hozzászólás Aktív témák
-
filomena98
friss újonc
Kedves Mindenki!
Van itt valaki, aki tudna segíteni kiválasztani a helyes válaszokat? Már napok óta rágódom rajtuk, de eddig csak arra jutottam, hogy már nem vagyok biztos semmiben.
1. Melyik a helyes allitas?
class MyClass{
static MyClass ref;
String[] arguments;
public static void main(String[] args){
ref = new MyClass;
ref.func(args);
}
public void func(String[] args){
ref.arguments = args;
}
}
A-nem kompilalhato, mert a statikus main metodus nem hivhat nem statikus matodust, mint a func
B-a program kompilalhato, es hiba nelkul mukodik
C-kompilalhato, de inditas utan hibat dob ki(exception)
D-nem kompilalhato, mert az args parametert a statikus main metodbol, nem lehet tovabbitani nem statikus metodusnak, mint a func
2.
Van egy osztalyunk aminek Book a neve.Az alabbiak kozul melyik a helyesen deklarant konstruktor?
A- public static void Book(String[] args){}
B-Book Book(){}
C-void Book(){}
D-egyik sem
3.
Melyik konstruktor helyezheto a 11. sorba, hogy ne legyen gond a kompilacional?
Class MySuper{
int number;
MySuper(int i){ number = i;}
}
class MySub extends MySuper{
int count;
MySub(int count,int num){
super(num);
this.count=count;
}
//ide kell kivalasztani a megfelelo konstruktort
}
A-MySub(int count){this(count, count);}
B-MySub(int count){super(count); this(count,0);}
C-MySub(int count){this.count=count; super(count);}
4.Melyik parameter deklaraciot lehet hasznalni a masodik sorban?
public class Testing{
//itt
public long getNum(String name){
Long number = accounts.get(name);
return number == null ? 0 : number;
}
public void setNum(String name, long number){
accounts.put(name,number);
}
}
A- private Map<String,Long> accounts = new HashMap<String,Long>();
B-private Map<String<Long>> accounts = new HashMap<String<Long>>();
C-private Map<String, long> accounts = new HashMap<String,long>();
D-private Map accounts = new HashMap();
E-private Map<String,Long> accounts = new Map<String,Long>();
5. Melyikallitas helyes?
class Fruit{}
class Apple extends Fruit{}
public class TestApp{
public static void main(String[] args){
List<? extends Apple> lst1 = new ArrayList<Fruit>();
List<? extends Fruit>lst2 =new ArrayList<Apple>();
List<? super Apple> lst3 = new ArrayList<Fruit>();
List? super Fruit> lst4 = new ArrayList<Apple>();
List<?> lst5 = lst1;
List<?> lst6=lst3;
List lst7 = lst6;
List<?> lst8 = lst7;
}
}
A- a 9. sor kompilalhato, a 10. nem
B- a 7. sor kompilalhato, a 8. nem
C- egyik valasz sem helyes
D- 5. sor kompilalhato, a 6. nem
E-a 11. sor kompilalhato, a 12 . nem
6. Hol van a hiba a kodban?
public class MyClass{
public static void main(String[] args) throws A{
try{
f();
}finally{
System.out.println("Done.");
}catch(A e){
throw e;
}
}
public static void f() throws B{
throw new B();
}
}
class A extends Throwable{}
class B extends A{}
A-a mainbe throw A helyett throw B kell
B-mainben a finally blocknak a catch block utan kell kovetkeznie
C-try block utan nem lehet egyszerre finally es catch block is
D-a main metodban, a catch blokban, A e helyett B e kellene
E-az A osztaly deklaracioja nem helyes
7. Mit ir ki a program inditas utan?
public class MyClass{
public static void main(String[] args) throws InterruptedException{
try{
f();
System.out.println("1");
}finally{
System.out.println("2");
}
System.out.println("3");
}
static void f() throws InterruptedException{
throw new InterruptedException("Time to go home.");
}
}
A- 2 es 3
B- 1 es 2
C- 2 es InterruptedExceptiont jelez
D-1, 2 es 3
E-3 es 2
F-1 es 3
8.Mi lesz az eredmeny futtatas utan?
public class MyClass{
public static void main(String[] args){
C c = new C();
System.out.println(c.max(13,20));
}
}
class A{
int max( int x, int y){ if( x>y) return x; else return y;
}
class B extends A{
int max(int x,int y){ return super.max(y,x)-10;}
}
class C extends B {
int max (int x, int y) { return super.max(x+10, y+10);}
}
A-a kod nem kompilalhato, mert nem egyertelmu a max() metodus hivasa
B- a kod kompilalhato, inditas utan 23-at ir ki
C-nem kompilalhato, mert a max () metodus a B osztalybanrossz sorrendben kuldi az argumenteket
D-kompilalhato,13-et ir ki
E-kompilalhato 29-et ir ki
F-kompilalhato, 39-et ir ki
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Interactive Brokers társalgó
- Kuponkunyeráló
- sziku69: Fűzzük össze a szavakat :)
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Samsung Galaxy Felhasználók OFF topicja
- Allegro vélemények - tapasztalatok
- Iqos cigaretta
- Spórolós topik
- Vigneau interaktív lokálblogja
- One otthoni szolgáltatások (TV, internet, telefon)
- További aktív témák...
- MikroTik RB962UiGS-5HacT2HnT- hAP ac RouterBoard 2,4GHz - 5GHz
- PS Vita 2000 japán dobozos újszerű állapot, új aksi, 16 GB Sony, 256 GB SD kártya, hordtáska
- SZÉP ÉS OLCSÓ! 100% akku és csak 6 hónapos, iPhone 16e 128GB AZONNAL! - Space Black! 155.990Ft
- Jura Ena 8 kávégép
- Dell Precision 5520 15,6" FHD, Xeon E3-1505M v5, 16GB RAM, Quadro 4GB VGA, SSD, jó akku, számla, gar
- ÁRGARANCIA!Épített KomPhone i5 10400F 16/32/64GB RAM RX 7600 8GB GAMER PC termékbeszámítással
- GYÖNYÖRŰ iPhone 13 Pro 256GB Gold -1 ÉV GARANCIA - Kártyafüggetlen, MS3963
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7500F 32/64GB RAM RTX 5060 Ti 8GB GAMER PC termékbeszámítással
- Új Dell 13 XPS 9350 WUXGA IPS Nano Ultra5 226V 8mag 16GB 512GB SSD Intel ARC 130V 8GB Win11 Garancia
- BESZÁMÍTÁS! MSI Katana15 HX B14WEK notebook - i7 14650HX 16GB DDR5 1TB SSD nVidia RTX 5050 8GB WIN11
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopszaki Kft.
Város: Budapest



