Exemple QC M

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

Université de Gabés

Faculté des Sciences de Gabés

LGLSI 2 – LIRIS 2
Semestre 1

Préparation à la certification Java


Exemples de QCM
Dhikra KCHAOU
dhikrafsegs@gmail.com

2023-2024
Question N°1

2 Certification des technologies JAVA Dhikra Kchaou


Question N°1

3 Certification des technologies JAVA Dhikra Kchaou


Question N°1

4 Certification des technologies JAVA Dhikra Kchaou


Question N°2

5 Certification des technologies JAVA Dhikra Kchaou


Question N°2

6 Certification des technologies JAVA Dhikra Kchaou


Question N°2

7 Certification des technologies JAVA Dhikra Kchaou


Question N°3
 You are writing a Java method.
 The program must meet the following requirements:
 Accept a String parameter firstName
 Display a welcome message that contains firstName
 Ensure that the first letter of the name is capitalized, and the
remaining letters are in lowercase
 How should you complete the code? To answer, drag the
appropriate code segment to the correct position. Each code
segment may be used once, more than once, or not at all.

8 Certification des technologies JAVA Dhikra Kchaou


Question N°3

Code Segments Answer Area

charAt substring Public String showGreating (String firstname)


toLowerCase toUpperCase {

String welcoming =‘’Welcome, ’’;

welcoming += firstname. (0,1). ()

+firstname. (1). () ;

return welcoming;

9 Certification des technologies JAVA Dhikra Kchaou


Question N°3
Code Segments Answer Area
charAt subString
toLowerCase toUpperCase Public String showGreating (String firstname)
{

String welcoming =‘’Welcome, ’’;

welcoming + = firstname. Substring (0,1) . toUppercase () +

firstname. substring (1). toLowerCase () ;

return welcoming;

10 Certification des technologies JAVA Dhikra Kchaou


Question N°4
 Given the code fragment:

 Which code fragment, when inserted at line n1, enables the App class
to print Equal?
11 Certification des technologies JAVA Dhikra Kchaou
Question N°4

12 Certification des technologies JAVA Dhikra Kchaou


Question N°4
 Which code fragment, when inserted at line n1, enables the App class
to print Equal?

13 Certification des technologies JAVA Dhikra Kchaou


Question N°5
 You are writing a Java program.
The program must meet the following requirements:
 Truncate firstName to its first five characters
 Set output to a string that contains the firstName and the number of
characters in firstName
 How should you complete the code? To answer, select the appropriate
code segments in the answer area.

14 Certification des technologies JAVA Dhikra Kchaou


Question N°5

15 Certification des technologies JAVA Dhikra Kchaou


Question N°5

17 Dhikra Kchaou
Question N°6

18 Certification des technologies JAVA Dhikra Kchaou


Question N°6

19 Certification des technologies JAVA Dhikra Kchaou


Question N°7
 Given the code fragment:

 What is the result?

20 Certification des technologies JAVA Dhikra Kchaou


Question N°7

21 Certification des technologies JAVA Dhikra Kchaou


Question N°7

22 Certification des technologies JAVA Dhikra Kchaou


Question N°8
 Given:

23 Certification des technologies JAVA Dhikra Kchaou


Question N°8

F. A B C C

24 Certification des technologies JAVA Dhikra Kchaou


Question N°8

F. A B C C

25 Certification des technologies JAVA Dhikra Kchaou


Question N°9
 Given the code fragment:

26 Certification des technologies JAVA Dhikra Kchaou


Question N°9

27 Certification des technologies JAVA Dhikra Kchaou


Question N°10
 Given:

28 Certification des technologies JAVA Dhikra Kchaou


Question N°10

29 Certification des technologies JAVA Dhikra Kchaou


Question N°11
 Given the following code:

30 Certification des technologies JAVA Dhikra Kchaou


Question N°11

31 Certification des technologies JAVA Dhikra Kchaou


Question N°12
 You are developing a banking module. You have developed a class
named ccMask that has a maskcc method.
 Given the code fragment:

32 Certification des technologies JAVA Dhikra Kchaou


Question N°12

 You must ensure that the maskcc method returns a string that hides all

digits of the credit card number except the four last digits (and the

hyphens that separate each group of four digits).

 Which two code fragments should you use at line n1, independently, to

achieve this requirement? (Choose two.)

33 Certification des technologies JAVA Dhikra Kchaou


Question N°12

34 Certification des technologies JAVA Dhikra Kchaou


Question N°12

xxxx-xxxx-xxxx-1234-5678-9101-1121

xxxx-xxxx-xxxx-1234-5678-9101-1121

35 Certification des technologies JAVA Dhikra Kchaou


Question N°13
 Given the code fragment:

37 Certification des technologies JAVA Dhikra Kchaou


Question N°13

38 Certification des technologies JAVA Dhikra Kchaou


Question N°14

39 Dhikra Kchaou
Question N°14

40 Certification des technologies JAVA Dhikra Kchaou


Question N°15
 Given:

41 Certification des technologies JAVA Dhikra Kchaou


Question N°15

42 Certification des technologies JAVA Dhikra Kchaou


Question N°15

43 Certification des technologies JAVA Dhikra Kchaou

You might also like