Uploaded by Anel Bolatova

javablockchain (2)

advertisement





Import keyword is used to access package and its classes into the java program.
A class is a template used for the creation of objects. An object is an instance of a class.
String is basically an object that represents sequence of char values.
A hash is a function that meets the encrypted demands needed to solve for a blockchain
computation.
A hash (hash sum, hash code) is a meaningless sequence of numbers and letters, in other
words, a krakozyabra.
A hash function is a program that takes normal data and creates a krakozyabra out of it.
In the case of a set, the function accepts any combination (even a huge one) and each
time gives out a 64-character krakozyabra.
Blockchain
Блокчейн
Блокчейн - это децентрализованный реестр информации. Он состоит из блоков данных,
соединенных с помощью криптографии. (Криптография - это наука о методах
обеспечения конфиденциальности (невозможности считывания информации
посторонними лицами)). Проще говоря, блокчейн - это информация, хранящаяся в
цепочке блоков.
Блоки хранятся в последовательной цепочке, один за другим, в том порядке, в котором
они были добавлены.
Каждый блок содержит информацию не только о себе, но и о предыдущем блоке. Таким
образом, вы можете перейти от последнего блока к самому первому и восстановить всю
цепочку.
1) Blockchain is a decentralized register of information. It consists of blocks of data connected
using cryptography. (Cryptography is the science of methods of ensuring confidentiality (the
impossibility of reading information to outsiders)). In simple terms, a blockchain is information
stored in a chain of blocks.
The blocks are stored in a sequential chain, one after the other, in the order they were added.
Each block contains information not only about itself, but also about the previous block. So you
can get from the last block to the very first and restore the entire chain.
Anel
1. Java JDK JRE
First of all, we have to open a lab folder in a text editor Sublime Text.
2.
Then in files we have to find a “main” method since in any Java program, the main() method is
the starting point from where compiler starts program execution. So, the compiler needs to call
the main() method. In our case it’s located in “src” subfolder of lab8 folder. The exact Java file is
NoobChain.java.
3. After we found out that all the work run via NoobChain, we need to open this file on the
Command prompt. We should open a lab folder in cmd and to display a list of files and
subfolders for the specified folder, we need to enter the dir command:
4. The next step is to open the src subfolder, inside which the NoobChain is located. Next we
need to compile the Noobchain file.java by entering java c Noobchain.java.
5. We can view the compiled files in the src subfolder: block.class , Noobchain.class ,
StringUtil.class. Java file GsonBuilder hasn’t compiled (MAYBE return null -> Nulls are
assigned only to reference types, it means the reference doesn't point to anything.).
Anel 6. The final step we need to run the code by entering java Noobchain and we get a
mathematical transformation of information into a string of 64 elements. + concl





Import keyword is used to access package and its classes into the java program.
A class is a template used for the creation of objects. An object is an instance of a class.
String is basically an object that represents sequence of char values.
A hash is a function that meets the encrypted demands needed to solve for a blockchain
computation.
A hash (hash sum, hash code) is a meaningless sequence of numbers and letters, in other
words, a krakozyabra.
A hash function is a program that takes normal data and creates a krakozyabra out of it.
In the case of a set, the function accepts any combination (even a huge one) and each
time gives out a 64-character krakozyabra.
• Ключевое слово Import используется для доступа к пакету и его классам в программе
java. Java has an import statement that allows you to import an entire package (as in earlier
examples), or use only certain classes and interfaces defined in the package.
• Класс - это шаблон, используемый для создания объектов. Объект - это экземпляр
класса. Basically, a class is used to create an object. It determines the variables and methods that
will be inside the object.
• Строка - это в основном объект, представляющий последовательность значений char. In
Java, a string is a sequence of characters. For example, "hello" is a string containing a sequence
of characters 'h' , 'e' , 'l' , 'l' , and 'o' .
• Хэш - это функция, которая отвечает зашифрованным требованиям, необходимым для
решения вычислений в блокчейне.
Хэш (хэш-сумма, хэш-код) - это бессмысленная последовательность цифр и букв, другими
словами, кракозябра.
• Хэш-функция - это программа, которая берет обычные данные и создает из них
кракозябру.
В случае набора функция принимает любую комбинацию (даже огромную) и каждый раз
выдает 64-символьную кракозябру.
There are three major components of class in Java.
1) Variable
Variable is a reserved memory location to hold a value. In other words, when we want to store
any value and give it a name, that value takes a reserved space in memory and it’s called as a
variable.
2) Constructor
A constructor is like a special method in Java, which is used to initialize an object of a Java class
and Constructor is very important for every Java class and if we don’t declare the constructor,
the compiler creates a default constructor of a Java class.
A constructor must be the same name of a Java class. It does not have a return type.
3) Method
A method is a block of code which only runs when it is called. You can pass data, known as
parameters, into a method. Methods are used to perform certain actions, and they are also known
as functions.
В Java есть три основных компонента класса.
1) Переменная
Переменная - это зарезервированная ячейка памяти для хранения значения. Другими
словами, когда мы хотим сохранить какое-либо значение и присвоить ему имя, это
значение занимает зарезервированное место в памяти и вызывается как переменная.
2) Конструктор
Конструктор подобен специальному методу в Java, который используется для
инициализации объекта класса Java, а конструктор очень важен для каждого класса Java, и
если мы не объявляем конструктор, компилятор создает конструктор класса Java по
умолчанию.
Имя конструктора должно совпадать с именем класса Java. У него нет возвращаемого
типа.
3) Способ
Метод - это блок кода, который выполняется только при его вызове. Вы можете
передавать данные, известные как параметры, в метод. Методы используются для
выполнения определенных действий, и они также известны как функции.
Какие элементы могут содержать класс Java?
Класс может содержать любой из следующих видов переменных: Локальные переменные,
определенные внутри методов, конструкторов или блоков. Они будут объявлены и
инициализированы в методе, и будут уничтожены, когда метод завершится. Переменные
экземпляра являются переменными в пределах класса, но и снаружи любого метода.
Import keyword is used to access package and its classes into the java program
Ключевое слово Import используется для доступа к пакету и его классам в программе
java.
if statement allows you to create a chain of if statements.
public is a Java keyword which declares a member's access as public.
public - это ключевое слово Java, которое объявляет доступ участника общедоступным.
public means that the method will be visible from classes in other packages.
static means that the method is not attached to a specific instance, and it has no " this ". It is
more or less a function.
void is the return type. It means "this method returns nothing".
общедоступный означает, что метод будет виден из классов в других пакетах.
статический означает, что метод не привязан к определенному экземпляру, и у него нет "
этого". Это более или менее функция.
void - это возвращаемый тип. Это означает, что "этот метод ничего не возвращает".
Download