Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.io.*;
- import java.math.*;
- import java.util.*;
- class A
- {
- public int a;
- public A(int b)
- {
- this.a = b;
- }
- public void print()
- {
- print(a);
- }
- }
- public class Main {
- public static void main(String[] args) {
- List<Integer> arr = new ArrayList<Integer>(); //массив
- int a = arr.get(index); //получить элемент массива
- arr.set(index, value);//поменять элемент массива на данный
- arr.add(val);//push_back
- set<Integer> s = new HashSet<Integer>();
- s = new TreeMap<>();
- s.add(4);//добавление в set
- bool isInside = s.contains(4);//
- Iterator<Integer> it = s.iterator();
- while(it.hasNext())
- {
- int a = it.next();
- }
- Map<Integer, String> m;
- m = new HashMap<>();
- m = new TreeMap<>();
- m.put(key, value); //положить
- string a = m.get(key); // получить
- bool f1 = m.containsKey();
- bool f2 = m.containsValue();
- Arrays.Sort(arr);
- Collections.sort(list, new Comparator<String>() {
- public int compare (String s1, String s2)
- {
- return (1 || 0 || -1);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement