Hirdetés
- Külföldi prepaid SIM-ek itthon
- Amazfit Bip 6 - jót olcsón
- Visszatérnek a Samsung tervezte CPU-magok és GPU az Exynos 2800-ban?
- Apple iPhone 15 Pro Max - Attack on Titan
- Telekom mobilszolgáltatások
- Cseresznyepiros és mokka barna Redmi Note 15-ök az újévre
- CES 2026: Érintőceruzát támogató komolyabb Motorola várható
- Redmi Note 12 Pro - nem tolták túl
- Rugalmas OLED panelre válthat a Samsung Galaxy A57
- iPhone 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?:))
- Retro Lenovo ThinkPad laptop csomag (T400, T61, X61s) - 3 db egyben
- 15.gen! Intel Core Ultra 5 245KF +16-32GB DDR5 RAM +hűtött VRM-es B860 lap! GAR/SZÁMLA (Te nevedre)!
- -70% FULLOS Lenovo ThinkPad T14: Ryzen 7 4750U 8mag, 32GB, 512GB, 14" FHD, vil.HU bill,IR,ujj.olv
- Ryzen 7 7700X +hűtött VRM-es B650M lap +16-32GB DDR5 RAM! GAR/SZÁMLA (a Te nevedre kiállítva)!
- 100/100% 500GB SSHD, 500GB HDD - több db - 2,5"
- BESZÁMÍTÁS! ASUS H510M i5 11400F 16GB DDR4 512GB SSD RX 6600XT 8GB Zalman T4 Plus Cooler Master 650W
- Telefon felvásárlás!! Xiaomi Redmi Note 12, Xiaomi Redmi Note 12 Pro, Xiaomi Redmi Note 12 Pro+
- ÚJÉVI AKCIÓK / MICROSOFT WINDOWS 10,11 / OFFICE 16,19,21,24 / VÍRUS,VPN VÉDELEM / SZÁMLA / 0-24
- HIBÁTLAN iPhone 13 Pro Max 256GB Sierra Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3521
- BESZÁMÍTÁS! GIGABYTE A520M R5 5500 16GB DDR4 256GB SSD 1TB HDD GTX 1060 6GB Zalman T3 Plus 400W
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest



