();
list.add("Rick");
list.add("Negan");
list.add("Daryl");
list.add("Glenn");
list.add("Carl");
list.forEach(
(names)->System.out.println(names)
);
}
116. Натижа қандай бўлади?
public static void main(String[] args) {
String str = "Men";
concat(str);
System.out.println(str);
}
public static void concat(String s){
s = s + " talabaman.";
}
117. Натижа қандай бўлади?
ALTER TABLE order_details
ALTER COLUMN notes TYPE varchar(500);
118. Натижа қандай бўлади?
SELECT 'a' || 'b' || 'c' || 'd' AS result;
119. Натижа қандай бўлади?
SELECT current_date + 1;
120. Натижа қандай бўлади?
public static void main(String[] args) {
int a = b(5);
System.out.println(a);
}
static int b(int n)
{
int output;
if(n==1){
return 1;
}
output = b(n-1)* n;
return output;
}
121. Натижа қандай бўлади?
try{
int num=121/0;
System.out.println(num);
}
catch(ArithmeticException e){
System.out.println("Number should not be divided by zero");
}
finally{
System.out.println("This is finally block");
}
122. Натижа қандай бўлади?
var greeter = "hey hi";
function newFunction() {
greeter += "\n hello";
}
console.log(greeter);
123. Натижа қандай бўлади?
public static void main(String[] args) {
int[] a = {1,3,4,5,6,7};
for (int i =1; i< a.length; i++){
System.out.println(a[i]);
}
}
124. Натижа қандай бўлади?
public static void main(String[] args) {
A a = new A();
System.out.println(a.new B().y);
}
static class A {
int x = 10;
class B {
int y = 15;
}
}
125. Натижа қандай бўлади?
public class Main {
public static void main(String[] args)
{
System.out.println("Hi Geek (from main)");
Main.main("Geek");
}
public static void main(String arg1)
{
System.out.println("Hi, " + arg1);
Main.main("Dear Geek", "My Geek");
}
public static void main(String arg1, String arg2)
{
System.out.println("Hi, " + arg1 + ", " + arg2);
}
}
126. Натижа қандай бўлади?
int a;
int b;
Main()
{
a = 10;
b = 20;
}
Main get()
{
return this;
}
void display()
{
System.out.println("a = " + a + " b = " + b);
}
public static void main(String[] args)
{
Main object = new Main();
object.get().display();
}
127. Натижа қандай бўлади?
static class Const{
private static final String str = "hi";
public static final String str2 = str + " Guys";
}
public static void main(String[] args)
{
System.out.println(Const.str2);
}
128. Натижа қандай бўлади?
select (select s.firstname | ' '| s.lastname * from student s where s.id = u.id) from university u.id = 5;
129. Натижа қандай бўлади?
public static void main(String args[])
{
List al = new ArrayList<>();
al.add(10);
al.add(20);
al.add(30);
al.add(1);
al.add(2);
al.remove(1);
al.remove(1);
System.out.println( al);
}
130. Натижа қандай бўлади?
public static void main(String args[])
{
int x = -4;
System.out.println(x>>1);
int y = 4;
System.out.println(y>>1);
}
131. Натижа қандай бўлади?
public static void main(String args[])
{
float n = 5.2f;
System.out.printf("n = %.4f\n", n);
}