Тести
Мова сайту: Українська
Українська
English
Русский
Тести з програмування
Вхід
Реєстрація
Тести з програмування
Теорія
Сніпети
Статті
Головна
Android
Ціни
FAQ
Історія Cosmo
Правила та умови сервісу
Політика конфіденційності
Політика щодо файлів cookie
Зворотній Зв’язок
strings
:
Мова контенту: English
Русский
What will be the result of the following program execution? import java.util.*; public class TestFormatter { public static void main(String... args){ Integer I1 = 0; Integer I2 = -1; Integer I3 = 1; Formatter f = new Formatter(); f.format("%1$b ", I1.toString()) .format("%1$b ", I2.toString()) .format("%1$b ", I3.toString()); System.out.println(f.toString()); } }
strings
What will be the result of the following code execution? String s1 = "str"; String s2 = "str"; System.out.println("Result: " + s1 == s2);
strings
What can be said about the following program? public class String { static String[][]String = {{"String"}}; // 1 static { System.out.println(String.class); // 2 } public static void main(String[] args) { // 3 System.out.println(String.class); // 4 } }
strings
What will be the result of the following code execution: String s1 = "abc"; String s2 = new String("abc"); String s3 = "abc"; System.out.println(s1 == s2); System.out.println(s1 == s3); System.out.println(s1 == "abc");
strings
What will be displayed, if the following code is compiled and executed: public class Main { public static void main(String args[]) { System.out.println("2 + 2 = " + 2 + 2); } }
strings
Which of the following pieces of code are considered to be a correct Java code?
strings
What is the result of the following program execution, given that 49 is an ASCII code for 1? public class A { public static void main(String[] args) { byte[] a={ 49,50,51,52,53,54,55 }; String b=new String(a); // 1 System.out.println(b); String c=new String(a,2,4); // 2 System.out.println(c); } }
strings
What will be displayed as a result of the following program execution? public class Main { public static void main(String[] args) { Formatter formatter = new Formatter(Locale.ROOT); formatter.format("%.2E\n", 100.0/3.0); //1 formatter.format("%.2f", 100.0/3.0); //2 System.out.println(formatter); } }
strings
What will be displayed to console after the following code is executed? public class Test { public static void main(String[] args) { String s = new String("ssssss"); StringBuffer sb = new StringBuffer("bbbbbb"); s.concat("-aaa"); sb.append("-aaa"); System.out.println(s); System.out.println(sb); } }
strings
What will be printed out after the following code is compiled and executed? String d = "beekeeper"; d.substring(1,7); d = "w" + d; d.insert(3, "bee"); System.out.println(d);
strings
← Попередня
1
2
3
4
5
Наступна →
Зареєструйся Зараз
або
Підпишись на майбутні тести