fa
Feedback

فریب کلاهبرداران را نخورید! تل‌متریو این کانال‌ها را شناسایی و برچسب‌گذاری می‌کند 👉 برای مشاهده برچسب، اشتراک تهیه کنید

Чашечка Java

Чашечка Java

رفتن به کانال در Telegram

Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels

نمایش بیشتر
8 291
مشترکین
+324 ساعت
+127 روز
-4930 روز
آرشیو پست ها
Как внедрить Contract-First OpenAPI и как устроен центр авторизаций Переходим к докладам по backend с IT-конференции ЮMoneyDa
Как внедрить Contract-First OpenAPI и как устроен центр авторизаций Переходим к докладам по backend с IT-конференции ЮMoneyDay. Первый кейс о том, как мы внедряли Contract-First. Описали процесс перехода от Сode-First к написанию OpenAPI-спецификаций и генерации кода по ним. Во втором кейсе разбираем анатомию центра авторизаций. Рассказали, как организовать разработку и поддержку множества критичных процессов и спокойно спать по ночам. Смотреть доклады по backend Читать: https://habr.com/ru/post/590743/?utm_campaign=590743
22 نوامبر 2021, 10:34

Spring Cloud Config — обновление конфигурации Spring Cloud Config позволяет хранить настройки конфигурации сервисов в git-реп
Spring Cloud Config — обновление конфигурации Spring Cloud Config позволяет хранить настройки конфигурации сервисов в git-репозитории и управлять настройками централизованно. В этой статье поговорим об обновлении параметров, получаемых с сервера конфигурации. Читать: https://habr.com/ru/post/590761/?utm_campaign=590761
22 نوامبر 2021, 09:37

Туториал по JUnit 5 - Жизненный цикл JUnit 5 теста В JUnit 5 жизненный цикл теста управляется четырьмя основными аннотациями,
Туториал по JUnit 5 - Жизненный цикл JUnit 5 теста В JUnit 5 жизненный цикл теста управляется четырьмя основными аннотациями, то есть @BeforeAll, @BeforeEach, @AfterEach и @AfterAll. Вместе с тем, каждый тестовый метод должен быть помечен аннотацией @Testиз пакета org.junit.jupiter.api. Читать: https://habr.com/ru/post/590699/?utm_campaign=590699
22 نوامبر 2021, 09:05

nown as a mantissa and after e is known as an exponent. 3. Single Character Constants These constants can contain only a single character in single quotes. The single character is basically a character data type available in java. Example: The ‘5’, ‘a’, ‘45’ are valid single character constants whereas ‘ab’, ‘f5’, name are invalid single character constants. 4. String Constants String constants contain an order of characters enclosed in starting and ending double-quotes. Characters can include numbers, special characters, spaces, and alphabets. Example: The “String”, “.. ”, “456 ” are valid string constants. 5. Backslash Character Constants There are some specific backslash character constants defined in java. Like ‘\t’ is known as a horizontal tab and it can be used to provide spaces at the output. Some more backslash character constants are ‘\n’, ‘\f’, ‘\b’. This was all about constants and their types. I hope your understanding of constants has increased after this blog. If you still have any question’s you can ask them in the comments. Read: Types of Constants in Java.
22 نوامبر 2021, 07:24
22 نوامبر 2021, ~08:58

Types of Constants in Java Whenever we declare a constant in java its value tends to be the same throughout the entire program. In the case of a normal variable, we can change the assigned value. Java doesn’t allow the use of constants directly so we use static and final non-access modifiers. The main motive of using constants is to decrease repeatability in the code with some standard values. It is cached by the Java Virtual Machine and written code results in improvement of the performance. Let’s see the below example for declaring constant with the final keyword: import java.util.*; public class constants { public static void main(String[] args) { final int mod=1000000007; System.out.println(mod); } } In the above code, we have declared a variable mod having 1000000007 as a value inside it. We have written “final” at the starting of the code stating that this cannot be changed at any point inside the code. You can take the value of constant as an input from the user too as it is not compulsory to assign values during declaration. If we try to change the value of a final variable then the compiler will show an error in compile time and run time as well. Let’s see the below example. import java.util.*; public class constants { public static void main(String[] args) { final int mod=1000000007; mod =mod+5; System.out.println(mod); } } Output: Exception in thread “main” java.lang.Error: Unresolved compilation problem: The final local variable mod cannot be assigned. It must be blank and not using a compound assignment at constants.main(constants.java:6) Declaring Constant Outside Main Method import java.util.*; public class constants { static final int standard_temp=37; public static void main(String[] args) { System.out.println(standard_temp); } } In the above code, static keyword is used while declaring the standard_temp variable so that it can be called inside the main method. So these were some of the ways to declare constants. I hope you have understood all of them. Now let’s see the types of constants. Types of Constants in Java Mainly there are two types of constants in java i.e, Numeric constant and Character constant but they have further types which we will be seeing below: 1. Integer Constants These constants contain an order of digits that can either be positive or negative in nature. They are further divided into decimal integer constants, octal integer constants, and Hexadecimal constants. Decimal Integer It is an order of integers starting from 0 till 9, and they can be either negative or positive. It’s up to you to specify the plus sign or not as it is optional. Example: The 55, -44, +546 numbers are valid whereas numbers like 11.01, 45 56, @12 are not valid because they either include some special characters, space, or decimal. Octal Integer Octal means 8 therefore it is an order of integers starting from 0 till 7, but it always starts from 0. So you need to remember that 8 & 9 cannot be written in the octal representation of any number. Example: The 033, 0,0111 numbers are valid. Hexadecimal Integer These constants can contain digits from 0 to 9, and also alphabets starting from a to f both in small as well as in the capital. They always start either from 0x or 0X. Example: The 0x22, 0xA2, 0X2B numbers are valid. 2. Real Constants These constants contain fractional numbers in them. Real constants must have decimal values and they can either be negative or positive. Each real constant can be expressed as exponents also. Example: The 23.5, 45.6756e2 numbers are valid. In 45.6745e2, the number before e is k[...]
22 نوامبر 2021, 07:24
22 نوامبر 2021, ~08:58

5. Exit"); System.out.println("Please write an option: "); option=sc.nextInt(); switch(option) { case(1): System.out.println("Please Enter the value to add: "); int temp=sc.nextInt(); myset.add(temp); break; case(2): System.out.println("Please Enter the value you want to remove "); int ind=sc.nextInt(); myset.remove(ind); break; case(3): System.out.println("The size of sett is: "+myset.size()); break; case(4): System.out.println("The elements of the set are: "+myset); break; case(5): break; } }while(option!=5); } } This was brief information about the collection hierarchy in Java. Comment down below if you have any queries. Read: Java Collection Hierarchy.
22 نوامبر 2021, 07:24
22 نوامبر 2021, ~08:58

s: "+myvec.size()); break; case(4): System.out.println("Enter the index: "); int index=sc.nextInt(); System.out.println("The value is: "+ myvec.get(index)); break; case(5): System.out.println("The vector is as follows: "+myvec); break; case(6): break; } }while(option!=6); } } Stack Stack arranges the values by the last in the first out (LIFO) method. We can add elements by the push method and remove them by the pop method. The way of creating a stack is as follows. import java.util.*; public class stackfunctions { public static void main(String[] args) { Stack<integer mystk=new Stack(); Scanner sc=new Scanner(System.in); int option; do{ System.out.println("1. Enter a new integer value to add in the stack"); System.out.println("2. Removing the item at the top of the stack"); System.out.println("3. Find the size of the stack"); System.out.println("4. Printing the whole stack"); System.out.println("5. Exit"); System.out.println("Please write an option: "); option=sc.nextInt(); switch(option) { case(1): System.out.println("Please Enter the value to add: "); int temp=sc.nextInt(); mystk.push(temp); break; case(2): int t=mystk.pop(); System.out.println("The value "+t+" has been removed successfully from the stack."); break; case(3): System.out.println("The size of Stack is: "+mystk.size()); break; case(4): System.out.println("The stack is as follows: "+mystk); break; case(5): break; } }while(option!=5); } } 2. Queue It contains the objects in a specific order in which they are added to the queue. If the queue is empty initially and we add a value then it will be at the starting of the queue as long as the queue exists. This method is also known as First In First Out (FIFO). It is implemented by Deque, PriorityQueue, ArrayDeque. import java.util.*; public class queuefunctions { public static void main(String[] args) { Queue<integer myqueue=new LinkedList(); Scanner sc=new Scanner(System.in); int option; do{ System.out.println("1. Enter a new integer value to add in the queue"); System.out.println("2. Removing the top element in the queue "); System.out.println("3. Find the size of the queue"); System.out.println("4. Printing the whole queue"); System.out.println("5. Exit"); System.out.println("Please write an option: "); option=sc.nextInt(); switch(option) { case(1): System.out.println("Please Enter the value to add: "); int temp=sc.nextInt(); myqueue.add(temp); break; case(2): myqueue.remove(); break; case(3): System.out.println("The size of Queue is: "+myqueue.size()); break; case(4): System.out.println("The queue is as follows: "+myqueue); break; case(5): break; } }while(option!=5); } } 3. Set It is a collection of objects which doesn’t allow the same values in the same set i.e, each value will be different in a set. So whenever we need unique values we use them to set in our programs. It is implemented by TreeSet, LinkedHastSet, and many more. We can create set objects with these classes. import java.util.*; public class setfunctions { public static void main(String[] args) { Set<integer myset = new HashSet<integer(); Scanner sc=new Scanner(System.in); int option; do{ System.out.println("1. Enter a new integer value to add in the set"); System.out.println("2. Enter the index on which the element you want to be removed"); System.out.println("3. Find the size of the set"); System.out.println("4. Printing the whole set"); System.out.println("[...]
22 نوامبر 2021, 07:24
22 نوامبر 2021, ~08:58

Java Collection Hierarchy The collection is a framework in java. It contains some of the most used classes which are present in the interfaces. Collection interface mainly has 3 child interfaces and these are as follows. Image Source 1. List It contains an order of all the objects. This interface also helps you to have a dynamic size of arrays according to the number of objects present. It is implemented by Vector, Stack, ArrayList, and LinkedList. Therefore we can create a list object with these classes. import java.util.*; public class list { public static void main(String[] args) { List<integer mylist=new ArrayList(); // Instead of ArrayList we can write LinkedList, Vector or Stack } } ArrayList Arraylist is a kind of dynamic array that stores values of all data types. It costs constant amortized time to add an element in ArrayList. Let’s look at the code to see different methods in ArrayList. import java.util.*; public class arraylistfunctions { public static void main(String[] args) { ArrayList<integer arrlist=new ArrayList(); Scanner sc=new Scanner(System.in); int option; do{ System.out.println("1. Enter a new integer value to add in the arraylist"); System.out.println("2. Enter the index on which the element you want to be removed"); System.out.println("3. Find the size of the Arraylist"); System.out.println("4. Enter the index of the element you want to be printed"); System.out.println("5. Exit"); System.out.println("Please write an option: "); option=sc.nextInt(); switch(option) { case(1): System.out.println("Please Enter the value to add: "); int temp=sc.nextInt(); arrlist.add(temp); break; case(2): System.out.println("Please Enter the index of value to remove it"); int ind=sc.nextInt(); arrlist.remove(ind); break; case(3): System.out.println("The size of Arraylist is: "+arrlist.size()); break; case(4): System.out.println("Enter the index: "); int index=sc.nextInt(); System.out.println("The value is: "+ arrlist.get(index)); break; case(5): break; } }while(option!=5); } } LinkedList It uses a doubly linked list while storing the values, so getting the first & last value takes constant time. As compared to ArrayList the manipulation is faster because of storing data in the doubly linked list. Its methods are quite similar to the ArrayList. Vector Vector also works as a dynamic array. It is advised to use vector in thread-safe implementations otherwise we should use ArrayList in all other cases. Let’s look at the below code to see its functions. import java.util.*; public class vectorfunctions { public static void main(String[] args) { Vector<integer myvec=new Vector(); Scanner sc=new Scanner(System.in); int option; do{ System.out.println("1. Enter a new integer value to add in the Vector"); System.out.println("2. Enter the index on which the element you want to be removed"); System.out.println("3. Find the size of the Vector"); System.out.println("4. Enter the index of the element you want to be printed"); System.out.println("5. Printing the whole vector"); System.out.println("6. Exit"); System.out.println("Please write an option: "); option=sc.nextInt(); switch(option) { case(1): System.out.println("Please Enter the value to add: "); int temp=sc.nextInt(); myvec.add(temp); break; case(2): System.out.println("Please Enter the index of value to remove it"); int ind=sc.nextInt(); myvec.remove(ind); break; case(3): System.out.println("The size of Vector i[...]
22 نوامبر 2021, 07:24
22 نوامبر 2021, ~08:58

photo content
22 نوامبر 2021, 07:24
22 نوامبر 2021, ~08:58

5 Best Free Courses to learn Vue.js for Beginners in 2022 [UPDATED] Hello guys, If you are self-teaching Vuejs yourself or wa
5 Best Free Courses to learn Vue.js for Beginners in 2022 [UPDATED] Hello guys, If you are self-teaching Vuejs yourself or want to learn Vue.js and looking for free online courses to start with, then you have come to the right place. In the past, I have shared free... Read: http://www.java67.com/2020/07/5-free-courses-to-learn-vuejs-in-2020.html
22 نوامبر 2021, 05:46
22 نوامبر 2021, ~05:47

5 Best Free Courses to Crack GCP Associate Engineer Certification Exam in 2022 Hello guys, if you are learning the Google Clo
5 Best Free Courses to Crack GCP Associate Engineer Certification Exam in 2022 Hello guys, if you are learning the Google Cloud platform and preparing for Google Cloud Associate Engineer certification or looking for free online courses to start your preparation, then you have... Read: http://www.java67.com/2020/09/free%20courses%20to%20pass%20google%20cloud%20engineer%20certification%20exam.html
22 نوامبر 2021, 05:46

5 Best Free Flutter Courses Online for Beginners in 2022 - Best of Lot Hello guys, if you want to learn Flutter for App devel
5 Best Free Flutter Courses Online for Beginners in 2022 - Best of Lot Hello guys, if you want to learn Flutter for App development in 2022 and looking for free Flutter courses then you have come to the right place.  In the past, I have shared the best Flutter... Read: http://www.java67.com/2020/06/5-free-courses-to-learn-flutter-in-2020.html
22 نوامبر 2021, 05:46

5 Best Free Bootstrap Online Courses for Beginners in 2022 [UPDATED] Bootstrap is one of the most popular front-end libraries
5 Best Free Bootstrap Online Courses for Beginners in 2022 [UPDATED] Bootstrap is one of the most popular front-end libraries, which provides a customizable HTML, CSS, and JavaScript template for creating a modern and responsive website. All the beautiful websites you... Read: http://www.java67.com/2019/01/5-free-bootstrap-course-to-learn-online.html
22 نوامبر 2021, 05:46
22 نوامبر 2021, ~05:50

Top 5 Best Free Courses to learn JDBC Java Programmers in 2022 - Best of Lot Hello guys, If you are a Java programmer and loo
Top 5 Best Free Courses to learn JDBC Java Programmers in 2022 - Best of Lot Hello guys, If you are a Java programmer and looking for some free and best JDBC courses to start learning database access in Java, then you have come to the right place. In this article, I am going... Read: http://www.java67.com/2018/03/top-5-free-jdbc-courses-for-java.html
22 نوامبر 2021, 05:46

Top 5 Free Courses to learn jQuery for Beginners in 2022 - Best of Lot Hello guys, if you are thinking of learning jQuery, on
Top 5 Free Courses to learn jQuery for Beginners in 2022 - Best of Lot Hello guys, if you are thinking of learning jQuery, one of the best JavaScript libraries for client-side development, and looking for some excellent free resources like books, tutorials, and online... Read: http://www.java67.com/2018/04/top-5-free-jquery-courses-for-web-developers.html
22 نوامبر 2021, 05:46
22 نوامبر 2021, ~05:50

Туториал по JUnit 5 - Введение В этом туториале по JUnit 5 рассказывается о том, как JUnit адаптировал стиль кодирования Java
Туториал по JUnit 5  - Введение В этом туториале по JUnit 5 рассказывается о том, как JUnit адаптировал стиль кодирования Java 8 и некоторые другие функции. Узнайте, чем JUnit 5 отличается от JUnit 4. JUnit 5 - наиболее широко используемая среда тестирования для приложений Java. JUnit долгое время отлично справлялся со своей задачей. Между тем, JDK 8 привнес в java интересные функции и, в первую очередь, лямбда-выражения. JUnit 5 был нацелен на адаптацию стиля программирования Java 8; вот почему Java 8 является минимально необходимой версией для создания и выполнения тестов в JUnit 5 (хотя можно запускать тесты, написанные с помощью JUnit 3 или JUnit 4 для обратной совместимости). Читать: https://habr.com/ru/post/590607/?utm_campaign=590607
22 نوامبر 2021, 04:12

Top 5 Free Swift Programming Courses for Beginners in 2022 - Best of Lot Hello guys, how are you doing this lazy Saturday? Yo
Top 5 Free Swift Programming Courses for Beginners in 2022 - Best of Lot Hello guys, how are you doing this lazy Saturday? You might be thinking, as a Java developer why I am suggesting you learn Swift. Still, the truth is that I am not suggesting you abandon Java and... Read: http://www.java67.com/2019/03/5-free-courses-to-learn-swift.html
22 نوامبر 2021, 02:39
22 نوامبر 2021, ~02:42

Top 5 Free Azure Solution Architect Technologies (AZ -303/304, AZ-300/301) Courses to Crack Exam in 2022 Hello guys, if you a
Top 5 Free Azure Solution Architect Technologies (AZ -303/304, AZ-300/301) Courses to Crack Exam in 2022 Hello guys, if you are preparing for Azure Solution architect technologies certification with code AZ--303 and AZ-304 or its older version AZ-300 and AZ-301 and looking for free online courses to... Read: http://www.java67.com/2020/09/5-free-courses-to-crack-azure-cloud-architect-exam-az-303-304-az-300-301.html
22 نوامبر 2021, 02:39

5 Free Oracle and Microsoft SQL Server Online Courses [2022] - Best of lot If you are an application developer, like someone
5 Free Oracle and Microsoft SQL Server Online Courses [2022] - Best of lot If you are an application developer, like someone developing a server-side application using Java or .NET or any other programming language which uses a database like Oracle and Microsoft SQL Server... Read: http://www.java67.com/2018/02/5-free-oracle-and-microsoft-sql-server-online-courses.html
22 نوامبر 2021, 02:39

Top 5 Free Bash and Shell Scripting in Linux for Beginners in 2022 - Best of Lot Hello guys, the importance of Linux is well
Top 5 Free Bash and Shell Scripting in Linux for Beginners in 2022 - Best of Lot Hello guys, the importance of Linux is well known but many programmers don't know how to write shell scripts to make most of it.  Some of them even not familiar with various Linux shells like... Read: http://www.java67.com/2019/04/top-5-free-course-to-learn-bash-shell-scripting-linux.html
22 نوامبر 2021, 02:39