RUVIDEO
Поделитесь видео 🙏

java tutorials part3

📁 Обучение 👁️ 16 📅 05.12.2023

Java programming language is platform-independent and a secure programming language. With a wide variety of applications
Documentation Section
• Package Statement
• Import Statement
• Interface Section
• Class Definition
• Main Method Class
There are three types of comments that Java supports
• Single line Comment
• Multi-line Comment
• Documentation Comment
1
2
3
4 // a single line comment is declared like this
/* a multi-line comment is declared like this
and can have multiple lines as a comment */
/** a documentation comment starts with a delimiter and ends with */
Package Statement
There is a provision in Java that allows you to declare your classes in a collection called package. There can be only one package statement in a Java program and it has to be at the beginning of the code before any class or interface declaration. This statement is optional, for example, take a look at the statement below.
1 package student;
This statement declares that all the classes and interfaces defined in this source file are a part of the student package. And only one package can be declared in the source file.
Import Statement
Many predefined classes are stored in packages in Java, an import statement is used to refer to the classes stored in other packages. An import statement is always written after the package statement but it has to be before any class declaration.
We can import a specific class or classes in an import statement. Take a look at the example to understand how import statement works in Java.
1
2 import java.util.Date; //imports the date class
import java.applet.*; //imports all the classes from the java applet package
Interface Section
This section is used to specify an interface in Java. It is an optional section which is mainly used to implement multiple inheritance in Java. An interface is a lot similar to a class in Java but it contains only constants and method declarations.
An interface cannot be instantiated but it can be implemented by classes or extended by other interfaces.
1
2
3
4 interface stack{
void push(int item);
void pop();
}
Class Definition
A Java program may contain several class definitions, classes are an essential part of any Java program. It defines the information about the user-defined classes in a program.
A class is a collection of variables and methods that operate on the fields. Every program in Java will have at least one class with the main method.
Main Method Class
The main method is from where the execution actually starts and follows the order specified for the following statements. Let’s take a look at a sample program to understand how it is structured.
1
2
3
4
5
6 public class Example{
//main method declaration
public static void main(String[] args){
System.out.println("hello world");
}
}
public class Example
This creates a class called Example. You should make sure that the class name starts with a capital letter, and the public word means it is accessible from any other classes.
Comments
To improve the readability, we can use comments to define a specific note or functionality of methods, etc for the programmer.
Braces
The curly brackets are used to group all the commands together. To make sure that the commands belong to a class or a method.
public static void main
• When the main method is declared public, it means that it can be used outside of this class as well.
• The word static means that we want to access a method without making its objects. As we call the main method without creating any objects.
• The word void indicates that it does not return any value. The main is declared as void because it does not return any value.
• Main is the method, which is an essential part of any Java program.
String[] args
It is an array where each element is a string, which is named as args. If you run the Java code through a console, you can pass the input parameter. The main() takes it as an input.
System.out.println();
The statement is used to print the output on the screen where the system is a predefined class, out is an object of the PrintWriter class. The method println prints the text on the screen with a new line. All Java statements end with a semicolon.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «java tutorials part3», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.