Hirdetés
- Kormányok / autós szimulátorok topikja
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- HiFi műszaki szemmel - sztereó hangrendszerek
- AMD Navi Radeon™ RX 9xxx sorozat
- OLED TV topic
- OLED monitor topic
- Vezetékes FEJhallgatók
- Azonnali informatikai kérdések órája
- Milyen billentyűzetet vegyek?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
Ú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?:))
- Kormányok / autós szimulátorok topikja
- Vivo X200 Pro - a kétszázát!
- Ezt nézed TikTokon és YouTube-on a telefonodon
- Kuponkunyeráló
- sziku69: Fűzzük össze a szavakat :)
- droidic: Safe Mode az agyban
- sziku69: Szólánc.
- Sorozatok
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- Torda: Így lehet fillérekből prémium okosotthon rendszert építeni 2025-ben
- További aktív témák...
- AMD Radeon RX 7600 8GB OC HIBÁTLAN!!
- Hibátlan 2+ Év Garancia! GIGABYTE GeForce RTX 4060 EAGLE OC 8GB
- AZONNAL KÉSZLETRŐL! AMD Ryzen 7 9800X3D 64GB 6000MHz RAM 2TB Gen4 SSD RTX 5090 32GB GDDR7 1200W
- AZONNAL KÉSZLETRŐL! Intel Core i5 14600K 64GB 6000MHz RAM 2TB Gen4 SSD RTX 5060 8GB FSP 750W
- AZONNAL KÉSZLETRŐL! Intel Core i5 14600K 32GB 6000MHz RAM 2TB Gen4 SSD RTX 5060 8GB FSP 750W
- Eredeti Microsoft Windows 10 / 11 Pro OEM licenc Akciós áron! 64/32 bit Azonnali kézbesítéssel
- Asus Zenbook 14 Laptop UX3402Z i7
- ÁRGARANCIA!Épített KomPhone i5 12400F 16/32/64GB RAM RTX 5060 Ti 8GB GAMER PC termékbeszámítással
- Nokia 8 Sirocco / 6/128GB / Kártyafüggetlen / 12Hó Garancia
- Apple iPhone 15 Pro Max - Blue Titanium - 256GB - Akku: 84% - Megkímélt állapot!
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest



