Hirdetés
- Mindenkinél több és erősebb AI gyorsítót ígér Elon Musk
- M.2 csatlakozók terén (is) jónak ígérkezik az MSI közelgő AMD-s alaplapja
- Kivégezheti a kisebb VGA-gyártókat az NVIDIA döntése
- Szinte a semmiből robbanna be az 1,4 nm-es eljárásával a Rapidus
- Félszáz terabájtos HDD-k előtt nyitotta ki az ajtót a Seagate
- TCL LCD és LED TV-k
- Mini PC
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Milyen TV-t vegyek?
- M.2 csatlakozók terén (is) jónak ígérkezik az MSI közelgő AMD-s alaplapja
- Gaming notebook topik
- Mini-ITX
- Amlogic S905, S912 processzoros készülékek
- HiFi műszaki szemmel - sztereó hangrendszerek
- Fejhallgató erősítő és DAC 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?:))
- ÁRGARANCIA! Épített KomPhone Ultra 9 285K 32/64GB RAM RTX 5070 Ti 16GB GAMER PC termékbeszámítással
- Bomba ár! HP ProBook 450 G8 - i3-1115G4 I 8GB I 256SSD I HDMI I 15,6" FHD I Cam I W11 I Gar
- iPhone 15 Pro Max 256GB Black Titanium -1 ÉV GARANCIA - Kártyafüggetlen, 100 % Akksi
- Bomba ár! HP EliteBook 2760P - i5-G2 I 4GB I 320GB I 12,1" Touch I Cam I W10 I Garancia!
- LG 27GS60QX-B - 27" Ívelt VA - 2560x1440 2K QHD - 180Hz 1ms - AMD FreeSync Premium
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest



