1. Trang chủ
  2. » Luận Văn - Báo Cáo

Hutech Thi Cuối Kỳ Lập trình hướng đối tượng 2020

19 1,9K 16

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 19
Dung lượng 26,55 KB
File đính kèm Trac nghiem LTHDT.rar (23 KB)

Nội dung

Trac nghiem LTHDT Java ho tro nhung dac diem nao sau day? A OOP B Doc lap flatform C Bao mat D Tat ca cac dac diem tren (ok) Source code cua java co ten mo rong la gi? A .class B .java (ok) C .com D Tat ca deu sai Java source code duoc trinh bien dich java bien dich A Bytecode (ok) B Executable code C Machine code D Tat ca deu sai Trinh nao se chuyen doi java source code file class A Javac (ok) B Java C Appletviewer D Tat ca deu sai E Tat ca deu dung Chuong trinh nao thuc thi mot class file JVM A Javac B Java (ok) C Appletviewer D Tat ca deu sai E Tat ca deu dung Trinh nao cho phep ta chay applet ben ngoai browser A Appletviewer (ok) B Www C Java D Tat ca deu sai E Tat ca deu dung Chon phat bieu sai A Co the xay dung mot ung dung huong thu tuc java (ok) B Khong the xay dung mot ung dung huong thu tuc java Co the dung mot trinh editor bat ky de viet code java khong? A Dung (ok) B Sai Co che cho phep mot ung dung java doc lap voi flatform A Moi platform co mot trinh java.exe rieng de thong dich file class (ok) B File.class co cau truc doc lap voi flatform (ok) C Moi cung cap he dieu hanh tao cach rieng de chay ung dung java 10 Bao dong la mot dac tinh cua OOP nham de: A Che giau du lieu B Ben ngoai chi giao tiep voi doi tuong thong qua mot so phuong thuc C Ca hai dung (ok) D Ca hai sai 11 Chon phat bieu dung A Tunh bao goi: dac diem dong goi thuoc tinh va hanh vi nham tao gioi han truy xuat toi mot doi tuong duoc goi la "black box" B Tinh thua ke: kha nang truyen cac dac diem cua mot lop sang mot lop khac goi la lop dan xuat C Tinh da hinh: kha nang cho phep dinh nghia lai mot hanh vi ke thua tu lop cha mot dan xuat D Tat ca dung (ok) 12 Cac kieu du lieu java gom A byte, short, int, long, char, float, double (ok) B Byte, Long, Int, Char, Float, Double C BYTE, LONG, INT, CHAR, FLOAT, DOUBLE D Tat ca dung 13 Cac tu khoa cau truc lap cua java A Do, While, For, Break, Continue B do, while, for, break, continue C do, while, for, break, continue, if, else D Tat ca sai 14 Cac hang java gom A True, False, Null B TRUE, FALSE, NULL C true, false, NULL D true, false, null (ok) 15 Cac toan tu so hoc java la A +,-,*,/,%, ++, (ok) B +,-,x,/,%, ++, -C D 16 Cac toan tu so sanh java A ,!= B , C (ok) 17 Toan tu gan java =,+=,-=,*=,/=,%= 18 Chon dap an dung nhat Int[] a = new int[5] Int a[] = new int[5] 19 Dinh nghia mang tuc thoi (in-line initialization) A int a[] = { 1,4,2,7,8} B int []a = { 1,4,2,7,8} C int a[5] = { 1,4,2,7,8} D Cau A, B dung (ok) 20 Cho biet cac dac diem cua lap trinh huong doi tuong A Dong goi B Ke thua C Da hinh D Tat ca cac dac diem tren (ok) 21 Kieu du lieu java duoc chia lam hai loai co ban nao? A Kieu gia tri don nguyen va kieu tham chieu (ok) B Con tro va gia tri C Kieu tro D Kieu du lieu truu tuong 22 Cu phap khai bao nhieu dong java A // B /* */ C /** **/ D / / 23 Khai bao mot dong java A // B /* */ C Ca hai cau sai D Ca hai cau dung (ok) 24 Access modifier cho bien java co the la? A public B private C protected D Tat ca dung (ok) 25 Cac cau truc lap trinh nao sau day phai thuc thi it nhat mot lan cac phat bieu ben A While B Do while (ok) C For D If 26 Nhan dang tu khoa java ho tro cho OOP A Class, Private, Public B Class, private, public C class, private, public (ok) D CLASS, PRIVATE, PUBLIC 27 Trong cac modifier cho mot phan cua class, modifier nao cho phep ben ngoai truy cap tu phan A Public (ok) B Private C Protected D Friendly 28 Modifier nao cho phep truy cap ben lop truy cap den phan A Public B Private (ok) C Protected D Friendly 29 Modifier cho phep cac doi tuong cung goi truy cap toi phan A Public B Private C Friendly, protected, public (ok) D Tat ca deu sai 30 Modifier nao chi gioi han cac doi tuong khac goi, khac lop, khong co quan he cha khong duoc truy cap toi phan A Public B Provate C Protected (ok) D Friendly 31 Ky thuat overload cho phep A Khai bao ham trung ten, trung tham so nhung khac kieu gia tri ham B Khai bao ham khac ten, khac kieu tham so, khac gia tri ham C Khai bao ham trung ten, khac kieu tham so, khac so luong tham so (ok) D Tat ca deu dung 32 Khi mot phan cua class duoc khai bao modifier la friendly thi phan A Khong cho phep cac doi tuong thuoc cac class cung package truy cap B Cho phep cac doi tuong thuoc cac class cung package (ok) C Cho phep cac doi tuong thuoc cac class cung package va khac package truy cap 33 Bien doi tuong java la A Tham chieu cua vung nho chua du lieu cua doi tuong (ok) B Bien static C Bien cuc bo D Tat ca deu sai 34 Neu modifier cua lop la public thi ten file Java A Phai trung ten class, phan biet chu hoa chu thuong (ok) B Phai trung ten class, phan biet cho hoa chu thuong C Khong phai trung voi ten class D Tat ca deu sai 35 Tu khoa this java la A Doi tuong cha cua doi tuong dang thao tac B Doi tuong dang thao tac (ok) C Ca hai dung D Ca hai sai 36 Phuong thuc khoi tao (constructor) la phuong thuc A Duoc thuc thi vao luc khoi tao doi tuong (ok) B Duoc thuc thi tu luc khoi huy doi tuong C Ca hai dung D Ca hai sai 37 Ten phuong thuc khoi tao A Khong duoc trung ten lop B Phai trung ten lop (ok) C Dat ten y D Tat ca dung 38 Phuong thuc khoi tao (constructor) la phuong thuc A Khong co kieu tra tri (ok) B Tra tri kieu void C Tra tri y D Tat ca deu dung 39 Trong mot lop ta co the A Khong dinh nghia ptkt nao B Dinh nghia ptkt C Dinh nghia nhieu ptkt D Tat ca dung (ok) 38 Phuong thuc khoi tao chuan A Co nhieu tham so B Co tham so C Khong co tham so nao (ok) D Tat ca deu dung 39 Ngon ngu java co san ptkt chuan lam cong viec A Xoa vung nho du lieu cua doi tuong ve hoac null (ok) B Ve hoac null C Ve D Ve null 40 Khi mot lop da co constructor A Constructor mac dinh cua ngon ngu van duoc sd B Khong duoc sd (ok) C Tat ca dung D Tat ca sai 41 Phat bieu nao duoc dung de thoat khoi mot vong lap A Continue B Goto C Break (ok) D Exit 42 Phat bieu nao duoc dung de bo qua mot so lenh mot lan lap A Continue (ok) B Goto C Break D Exit 43 Ten nao hop le java A Nhap mang B Nhap-mang C Nhap_mang (ok) D Nhap&mang 44 Ten nao sau day hop le java A _sinhvien (ok) B Sinh vien C Sinh@vien D Sinh-vien 45 Ten nao sau day hop le java A _san$pham B _san_pham C San_pham D Tat ca dung (ok) 46 Ma ascii cua '\t' la Int x = 3, y= 2; X + '\t' + y = 3+9+2=14 47 Boolean a = true, boolean b = false A && b = false 48 Int x =5, y =2; X+x%y=5+1=6 49 Neu la float cho cau 48 thi gia tri la 6.0 50 Str.substring(8) lay chuoi string bat dau tu ky tu thu chuoi 51 Ho chi minh Str.indexOf("chi"); -> 52 Chon cau lenh khong gay loi ben dich A Float f = 1.3; B Char c = "a" C Byte b = 257 ( byte chi co 12x) D Int i = 10; (ok) 53 Tu nao khong phai tu khoa java A If B Then (ok) C While D Case 54 Ten nao khong hop le java A Vari2 B _whatever C $whatever D #myvar (ok) 55 Int arr[] = new int[5]; System.out.println(arr[0]); Kq = 56 Int i =9; Switch(i){ Default: Sysout(a); Case 0: Sysout(b); Break; Case 1: Sysout(c); Cass 2: Sysout(d); Kq la a, b (vao default, vao case va break) 57 Math.floor lam tron can duoi Math.ceil lam tron can tren Math.round lam tron so Math.min phai truyen vao hai doi so moi tim duoc so nho nhat -4.7 muon lam tron -4.0 thi xai Math.ceil(-4.0); 58 Trong mot phuong thuc khoi tao A Khong duoc goi su dung mot phuong thuc khac B Duoc phep goi den mot phuong thuc khac (ok) C Tat ca dung D Tat ca sai 59 Khi su dung phuong thuc khoi tao, viec thuong lam la A Khoi tao gia tri cho cac phan du lieu cua doi tuong (ok) B Khai bao kieu cho cac phan du lieu cua doi tuong C Khai bao cac phuong thuc cua doi tuong D Tat ca sai 60 Doi tuong song ke tu A Khoi tao new den het chuong trinh B Khoi tao new den hey phuong thuc chua no C Khoi tao new den het khoi chua no (ok) 61 Trong java khong cho phep tu dinh nghia phuong thuc huy doi tuong, no co trinh don rac rieng D Tat ca dung 62 Phat bieu nao dung dung de khai bao lop java "MyClass" —> Class MyClass 63 Tinh ke thua la A Kha nang mot lop thua huong data tu mot hay nhieu lop khac B Kha nang mot lop thua huong code tu mot hay nhieu lop khac C Kha nang mot lop thua huong dât va code tu mot hay nhieu lop khac (ok) D Tat ca đu sai 64 Uu diem cua tinh ke thua 65 Cac loai thua ke A Don ke thua B Da ke thua C Tat ca dung (ok) D Tat ca sai 66 Don thua ke la A Lop co nhieu lop cha B Lop co mot lop cha (ok) C Tat ca sai D Tat dung 67 Da thua ke la A Lop co the co mot hay nhieu lop cha (ok) B Lop co mot lop cha C Tat ca sai D Tat ca dung 68 Tat ca cac ngon ngu ho tro A Don thua ke (ok) B Da thua ke C Don va da D Tat ca sai 69 Ngon ngu java ho tro A Don thua ke (ok) B Da thua ke C Don va da D Tat ca sai 70 Tu khoa extends java dung de -> khai bao thua ke lop cha 71 Khi dinh nghia lop con, tu khoa extends java -> Truoc lop cha va sau lop 72 Chin cau tra loi dung ve cac phuong thuc lop truu tuogg A Chi duoc khai bao ma khong viet code B Co the duoc khai bao ma khong viet code (ok) C Chi duoc khai bai ma phai viet code D Khong can phai khai bao vi lop tu hieu 73 Lop truu tuong A Chi co the la lop cha B Chi co the la lop co C A va B dung (ok) D A va B sai 74 Khi hien thuc lop truu tuong, tu khoa abstract java A Dat truoc ten lop va phuong thuc truu tuong (ok) B Dat sau ten lop va phuong thuc truu tuong C Dat sau ten lop va cac phuong thuc lop D Tat ca sai 75 Nhung modifier nao khong duoc phep ket hop abstract A Public B Protected C Final (ok) D Tat ca sai Public va protected duoc phep ket hop 76 Dac diem cua lop truu tuong A Khong the khoi tao mot doi tuong thuoc lop truu tuong (ok) B Co the C Chi co the duoc khoi tao mot doi tuong thuoc lop truu tuong doi tuong cung truu tuong D Tat ca sai 77 Chon cau dung A Mot bien thuoc lop truu tuong khong the chi den lop B Mot bien thuoc lop truu tuong co the chi den lop (ok) C Mot bie thuoc lop truu tuong khong de chi den lop tru lop truu tuong D Co the lop truu tuong 78 Chon cau phat bieu dung A Final khong chua truu tuong B Truu tuong khong chua final C A va B dung (ok) D A va B sai 79 Chon cau tra loi dung A Khong dung tu khoa extends ke thua kop truu tuong B Co the dung ky thuat overloading (ok) C A va B dung D A va B sai 80 Tinh da hinh cua huong doi tuong cua oop nho A Overloading B Overriding (ok) C Tinh da ke thua D Tinh don ke thua 81 Lop truu tuong A La ket qua cua viec khai quat qua cao den noi jhong biet viet code the nao B Lop co cac tinh chat chung cua nhung lop cu the C Lop co phuong thuc ma khong viet code D Tat ca dung (ok) 82 Khong the khoi tao doi tuong kieu lop truu tuong vi lop truu tuong khong duoc dinh nghia day du 83 Chon cau tra loi dung A Ta co the khai bao abstract va final B Ta khong the (ok) C Ta co the khai bao mot lop vua la abstract vua la final mot project D Tat ca sai 84 Lop truu tuong la lop co nhung phuong thuc chi duoc khai bao ma khong viet code 85 Dung tu khoa nao sau day de hien thuc mot interface A implement B implements (ok) C Implement D Implements 86 Cac phuong thuc mot interface duoc dung voi cac modifier nao A Public va private B Public va friendly (ok) 87 Khi mot lop cu the viet lai cac phuong thuc cua interface thi modifier cua cac phuong thuc cua no la A Friendly B.private C.public (ok) D.protected 88 Package bao gom cac class, interface va package con, phai khai bao o dong dau tien code java, moi package la mot thu muc chua lop 89 De su dung cac class khong cung package phai su dung A.export B.extend C.import (ok) D.include 90 Cu phap nao sau day khong hop le khai bao hang a=10 interface A Public interface int a=10 91 Trong mot file java, thu tu dung cua cac khai bao import, class, package la PACKAGE/IMPORT/CLASS 92 Khai bao nao sau day la khai bao cua phuong thuc truu tuong public abstract void add(); 93 De doc mot tap tin, ta su dung goi nao cac goi sau: java.io 94 Moi package chua cac class va interface 95 Phuong thuc interface la ngam dinh kieu public 96 Mot lop khong the khai bao vua la final vua la abstract 97 Khi chep cac tap tin class thi phai chep tat ca cac thu muc lan cau truc cua cac thu muc co lien quan 98 package PackageCha[.packageCon]; 99 Dung tu khoa gi de co duoc da ke thua java A.abstract B.package C.interface (ok) D.final 100 Phuong thuc final khong duoc override 101 Khai bao interface public interface MyInterface{} 102 Khai bao dung public interface MyInterface extends Ainterface, Binterface{} 103 Co the dung ky thuat overload va override lop truu tuong (ca hai deu dung) 104 Cac tham so lop truu tuong la A Tham tri (ok) B Tham chieu C Ca a va b dung D Ca a va b sai 105 Dac tinh truy xuat lop truu tuong —> khong the su dung 106 Chon cau tra loi dung Lop truu tuong khong the thua ke tu lop cu the 107 Bien doi tuong lop thua ke la THAM CHIEU 108 Co the su dung duoc tu khoa super va this lop truu tuong 109 Co the khoi tao constructor default lop truu tuong 110 Co the khoi tao constructor co tham so lop truu tuong moi truong hop 111 Moi lop truu tuong co the co vo so constructor 112 Constructor lop truu tuong mac dinh la friendly 113 Kieu tra tri cua constructor lop truu tuong —> KHONG CO KIEU TRA TRI 114 moi lop truu tuong deu la lop cua lop Object 115 Ioexception lalop quan ly loi gi java A Loi khong dung dang so B Lop nhap xuat (ok) C.khong tim thay file D.viet sai ten phuong thuc 116 Filenotfoundexception la loi j java -> khong tim thay file 117 Nosuchmethodexception la lop quan ly loi gi -> viet sai ten phuong thuc 118 Numberformatexception -> loi khong dung dinh dang so 119 InteruptedException -> loi cat ngang mot luong lenh dang duoc thuc thi 120 Eofexception -> loi co gang truy cap mot file o cuoi file 121 Illegalaccessexception -> loi truy cap mot class bi cam 122 Co bao nhieu loai loi la syntax va runtime 123 Trong java, thoi jan la mot so long theo don vi miligiay vao nam 1/1/1970 124 Trong cac class quan ly loi, class tren cung cua error la lop Throwable 125 Cau lenh nao sau day yeu cau he thong goi trinh gom rac cua java: system.gc() 126 Arithmeticexception la loi thuc thi mot phep toan 127 IllegalArgumentexception loi sai doi so cua ham 128 Arrayindexoutofboundexception la loi chi so ngoai tam cua mang 129 Nullpointerexception la loi truy xuat mot doi tuong chua khoi tao 130 Securityexception la loi truy cap bi cam 131 Classnotfoundexception la loi khong tim thay file class 132 Ket qua sau bien dich doan code a = 3.5 —> compilation error 133 Int a1 = Double a2 = (float) a1; Ket qua: no error 134 Tinh da hinh la: La da hinh thai, phan ung khac cho cung mot phuong thuc, co duoc la nho ky thuat override phuong thuc giua hai lop cha ... nghia day du 83 Chon cau tra loi dung A Ta co the khai bao abstract va final B Ta khong the (ok) C Ta co the khai bao mot lop vua la abstract vua la final mot project D Tat ca sai 84 Lop truu tuong... sau ten lop va cac phuong thuc lop D Tat ca sai 75 Nhung modifier nao khong duoc phep ket hop abstract A Public B Protected C Final (ok) D Tat ca sai Public va protected duoc phep ket hop 76 Dac... Chi co the la lop co C A va B dung (ok) D A va B sai 74 Khi hien thuc lop truu tuong, tu khoa abstract java A Dat truoc ten lop va phuong thuc truu tuong (ok) B Dat sau ten lop va phuong thuc truu

Ngày đăng: 14/12/2019, 18:35

TỪ KHÓA LIÊN QUAN

w