Java programming. Object variables, objects, references and pointers. Java and the Internet

💖 Do you like it? Share the link with your friends

I am 22 years old, I have an economic education. Just a year ago (February - March) I did not have any programming skills, and I encountered Java only in games on old Siemens (in the form of a “powered by Java” welcome window when starting the game).

A year ago I worked in the technical support department. I wouldn't say the work is bad or I don't like it, but it's not particularly interesting. And it so happened that at one point I started thinking - it would be nice to have a job that you wouldn’t go to with the feeling of “damn, I’m going to work again,” but that would bring pleasure. I thought - what would I do if I had, let’s say, a year during which I didn’t necessarily have to earn money, and I could do whatever I wanted? The answer somehow came by itself - I would sit at home and learn to program.

With its help, developers can develop and add interactive elements to their sites, create user interfaces, and create web applications without the help of other languages. The great thing here is that the language is open source, so access to all the modules that can be adopted and converted is completely free. Developers use it to create, modify, retrieve, and manipulate data. You're probably wondering why this language is still so popular.

Kristina Katsarska, University software. Learning is practical. These examples will help you learn the principles of object creation, inheritance, and other issues related to object-oriented programming. It is an object-oriented language with static types.

Then I decided that it was up to me. I understood that it would be difficult to learn programming from scratch, that this would be a temporary setback in my career (I had no doubt that the Junior Developer received less than I did at that job), but I took it as a step back in order to take two steps forward .

OK. No sooner said than done. Since I had absolutely no understanding of programming languages, my first idea was to study the language that I had heard the most about (it was used to develop software in the company where I worked) - PHP. Okay, the girl talked me out of it. She suggested that in their company (developing mobile applications) androiders write in Java + their salary seems to be good. I googled and googled, thought about it and decided to learn Java.

A large number of application programs are written in this language on many operating systems, as well as on some of the operating systems themselves. Each standard course course is divided into two parts - lectures and exercises. All lectures are described in detail and include many examples. There are demonstrations during the lectures and you can ask questions at any time.

The exercises are led by your lecturer. In addition to lectures and exercises, assignments are given in the form of homework. Additional exercises beyond those provided in each lesson are the key to successful mastery of the material being studied. Requirements are candidates for analytical thinking and mastery of English language at an intermediate level.

My first step was the traditional attempts to learn something new - arm yourself with books, master the theory, and go! This is how I got the book by Horstmann and Cornell - Java. Basics. It was March 2014.

Generally speaking, all my life I have been desperately bad at studying things from books. This is probably due to which way of perception predominates in a person. I always really learned the material only after I had practically worked through it, consolidated it, and played with it. Therefore, my first attempts to learn Java from a book were doomed to failure. The book is good though.

Group learning - from 4 to 8 students Students can use a personal laptop or a computer provided by the school. The certificate is awarded to students who attend all classes and have successfully mastered the course material. Days for classes Monday and Wednesday or Tuesday and Thursday from 30 to 30 Duration of the course - weeks. Discounts on computer training: - 10% for “Bring a Friend”. The discount is used by both parties. - 10% for “Billing for the next course”.

Programming or writing computer programs means creating the instructions that a computer will follow and running the program based on them. Numbers and zeros are the only language the computer understands. So-called binary code- a huge number of zeros and zeros, can be processed very quickly by your computer, but it is very tedious for a person, and the instructions are not effective. That's why man created special programs, making programming easier. In these programs, computers are given instructions in a specific form - called a programming language - which is easier to understand and learn.

Somewhere in April I came across the JavaRush VKontakte group.
Then everything went like it was on rails. Solve problems, many problems, which are accompanied by a small amount of theory - clearly the best way studying the material (at least for me). I sat at home, I sat at work and decided, decided, decided) It was then that I was further convinced that programming was interesting to me. I couldn't remember being so stuck on anything.

The programming language instruction then converts that program into binary code so the computer can process it. For example, a simple mathematical operation must be written in hundreds of characters in binary or machine code. However, using a programming language, it can be expressed in a few words. We can name programming languages, for example.

Overview of Basic Programming Paradigms

Programming paradigms or programming styles are based on specific features - algorithmic abstraction of data, statements, controls - and represent a specific way of thinking about a program and its creation. This paradigm is intended for computer laymen and beginners. It is characterized by chaos and incongruity. Programming languages ​​that support this paradigm are minimally structured and provide minimal facilities for data abstraction.

Three months passed, during which I reached level 20. It seemed to me that further language learning would go much faster if you already got a job as a programmer - then you would be in this environment 8 hours a day, 5 days a week and you would develop extremely quickly.

So in August I started sending out resumes. A couple of places sent me test tasks, as a result of which I did not receive any job offers - looking back, I am not surprised even once - I may have solved the task posed, but what a bad coding style I had) This, by the way, is a small minus of JavaRush - as long as the problem is solved and the tests are passed, the task is accepted, although your code may leave much to be desired. It is enough to install the same Checkstyle plugin in Intellij IDEA, and the situation will be different - it will highlight “doubtful” points in the code, which will allow you to write not only working, but also beautiful, correct code.

Object-oriented paradigm

This is one of the oldest paradigms, which is why it is called classical. It is typical for such a paradigm that the computation process is specified by sequences of sequential commands. Loops are also used to a large extent here. Object-oriented programming is the core element of so-called objects. These devices mainly simulate real world objects: people, objects, events, documents. Each object carries certain information about itself and can change this state upon request.

Be that as it may, in September I was called for the first interview. The vacancy contained approximately the following - a developer of any level, we will offer a salary corresponding to the skills.
At this interview, the tasks were approximately as follows - a code fragment was given. Is it written correctly, and what problems might there be?
I don't remember how many of them I got right. In general, it was necessary to remember about Null, almost all the questions were about it - that you should not access a method parameter without first checking it for (if param != null).

The program is then structured not by procedures, but by these objects. In the case of the functional paradigm, the computation process is based on the gradual application of functions. Functions apply to the results of other functions. Large programs can cause confusion. After the procedural paradigm, it is the second oldest.

In the logical paradigm, a computer program is represented as a set of facts and rules, called clauses. The programmer presents a statement to the computer and it, based on the facts and articles of the program, tries to prove the statement. Often we encounter languages ​​that are paradigm-based and add support for other necessary activities. If a whole group of such languages ​​emerges and a programming style is created, we can call it the emergence of a new paradigm. These include, for example, web programming, parallel and distributed programming, data programming.

Based on the results, I was offered to work for free for the first month (as an internship), then a salary that was lower (although not much) than at the place of work where I was.

I understood well that I shouldn’t expect wonderful proposals, because I knew little theory, practiced only in JavaRush, zero experience, and so on. Therefore, I agreed that I would leave in 2 weeks (the right time to quit at my old place).

The course you have in front of you will be a great introduction to the world of programming. The author will tell you all the most important language constructs, such as variables, data types, conditional statements, loops, arrays, objects or methods. We'll create our first program, learn the language syntax and the application development process. Gradually we will begin to introduce more elements, starting with basic elements such as variables or logical operators that allow us to manipulate data. We will also learn what types of data we can distinguish and what they are.

At the same time, I submitted my resume to another company. This company offered the following:
- 2 months of Java EE training (2 times a week for 4 hours)
- if you show good results (you successfully defend your project, which you have been writing for these two months), then you are offered a job.

The company is very good, foreign, well-known, and the working conditions are excellent - in short, I wanted to go there much more than the place where they had already made me an offer.
Selection for training with her involved 3 stages:
1. Doing practical tasks at home.
2. If successful, you are invited to computer testing in the office.
3. If the test is successful, you will be interviewed on the same day.

Using the knowledge gained, we will be able to create a simple program, which will show us a board game. We will also place tables that will allow us to store data and store such generated boards. In the next module we introduce issues related to object oriented programming, we will start here with basic constructs, methods, classes and objects in the following lessons to tackle more advanced topics such as encapsulation, polymorphism, inheritance and abstract classes.

We will also tell you about the test-driven development methodology that we will use in practice. This is a new look at programming and a skill that is in great demand in the labor market, because testing is a very important part of a developer’s job. In the next lesson we will write game logic simply using tests. We'll finish with the ships by creating an app that will allow us to play the full game until we have loaded all the ships. Finally, we'll also talk about collections, and more specifically the three main types: maps, lists, and collections.

I completed the practical tasks without any problems - many thanks to JavaRush and their problems, after which these tasks seemed quite simple. There were 3 tasks: on RegExp (Google helped, because I myself couldn’t stand them and didn’t remember), on algorithms (quite simple, more of a mental exercise) and on writing/reading from a file (there are a lot of these in the JavaRush course). I was invited to computer testing.

Finally, the course discusses issues such as

Collections - letter cards and collections And much, much more!

  • Object-oriented programming, methods, classes, objects.
  • Conditional requests.
  • Polymorphism, encapsulation, inheritance.
  • Test-driven development.
This will be an excellent source of knowledge for beginners who have not yet come into contact with creating their own programs.

No prior knowledge is required as the topics discussed are translated from scratch. A video course is the most effective and at the same time the most enjoyable form of learning. It is launched in such a way that you can follow it with interest and commitment and enjoy the project. The knowledge you gain in this course is not just dry theory, but also practical experience with years of experience that will make it easier for you to master the material and create your own programs. The technique is based on practice and the supplements we create will be discussed in detail. The course you have in front of you is the essence of practical knowledge and experience, along with shortcuts that save you hours of work and searching. You will learn practical examples. . Most young people starting their coding adventure prefer to start graphical environments development, where a program is created using graphic elements.

I prepared for testing using the quizful website (http://www.quizful.net/job-role/junior-java-developer). These tests helped a lot, some questions even ended up intersecting. I passed the test successfully and they started interviewing me.

I will probably never forget this interview in my life.

All the person interviewing me wanted to hear from me was the basics of Java theory, such as:
- what is the difference between checked exceptions and unchecked;
- what methods does the Object class have and why are they needed;
- what types of collections are there and why they are there;
- and a little about multithreading.

Thanks to the friendly and intuitive interface, beginners can focus on planning their first algorithms without having to learn new language simultaneously. This medium has been very useful for a while, but over time it begins to show its limitations. It is difficult to create more complex programs in them because the blocks take up too much screen space and it is difficult to look at the entire function. The second problem that you may encounter is the relatively complex use of other libraries or fragments of other programs.

JavaRush is an excellent course, it will teach you how to solve problems and program, but the theory (for interviews) needs to be learned separately, as I was convinced of by swimming in these issues like a fish in an aquarium.

Over the course of a week, I thoroughly studied this tutorial and went for a second interview on the eve of the day when I was expected to new job. Apparently, the person who interviewed me was most impressed by my sense of purpose (I knew that if I accepted this internship, what happened next depended only on me - in two months I would have figured out everything I needed). Be that as it may, I accepted this internship and refused to go to work at the place where I was previously offered.

When a programmer creates a dozen or so projects in the block environment, perhaps without even realizing it, the revolutionary idea that programming really isn't about blocks or code begins to dawn on him. These are just tools for moving your thoughts, your algorithm, into the computer's memory. At the core of programming is finding ways to solve problems and solve problems. When this happens, it turns out that program code in text form is not a problem. Compared to shorter blocks, it can read almost like a story and at the same time is more flexible.

Over the course of 2 months, we were introduced to many topics from Java EE, such as: Servlets, JSP, Hibernate JSF, Spring and much, much more - as a result of the internship, we were familiar (we had a rough idea) about the main stack of Java EE technologies. Also, during the internship, we wrote our own project, which at the end had to be successfully presented for employment.

To answer this question, we need to think about what our interaction with the physical world looks like. All things have their own type and have characteristics and behavior. If we take, for example, a specific car, we can say that it is a copy of a certain car model, which has color, weight, maximum speed, 4 wheels and 4 doors. We can observe these features, but only some of these features can be changed, for example we can paint a car for a new color. In addition to this, you can do certain things, such as opening the car door, starting it, driving it.

I just remember my first feelings when I was at the first lecture. I looked at the assignment for this project (it was given immediately at the very first lecture) and did not even understand where to start and how to do it.

I also remember what it took me to successfully do it. These two months, almost all the thoughts in my head were that successful employment and the fulfillment of a dream were in my hands and nothing more. It didn’t depend on anyone else whether I could do it. Only from me. I had already quit my job, had almost no money, and it was really hard. I sat in the morning, sat during the day, sat in the evening, but never tired of rejoicing - I don’t remember when I devoted myself to something with such obsession. This time once again helped me realize how much I like programming and how much I would like to work in this field.

At graduation I presented my project. I defended it really well, apparently much better than expected, and as an exception, I was hired not for the initial position, but immediately for the position of Middle Java Developer. It was December 9, 2014. I couldn't believe it, but the job offer was in front of me on my monitor. Software engineer. This happened.

I went back to work on December 15th. Never once have I had the thought “damn, I don’t want to go to work.” Every day, leaving home in the morning, I know why I am going to work, what I will do, and how much I want it. This makes me incredibly happy. It is worth and was worth the price you had to pay to achieve your dream.

I wish all of you who really want to be a programmer go ahead in achieving your goal. It is more than real, it is very close, but you have to pay for it. Pay with your wasted time and nerves, because learning something from scratch is really not the easiest step. JavaRush helped me take these first steps with ease, and I wasn't the one who turned away from programming at the very beginning because of the apparent complexity and abundance of theory. Thus, I was able to bring my rather crazy idea of ​​​​a radical change in the field of professional activity (even in the absence of technical education) to the end.

And you definitely can.

This section covers the fundamentals of an object-oriented language. Java programming. Java is the name given not only to the language itself, but also to the platform for creating and executing applications based on this language. The language was originally called Oak and was developed by James Gosling for programming consumer electronic devices. It was later renamed Java and used to write client applications and server software.

This language is named after the brand of Java coffee, beloved by some programmers, which is why the official logo of the language depicts a cup of steaming coffee.

With regard to pronunciation in the Russian language, as in a number of others, two different norms have emerged - the borrowed English language (“dʒɑːvə” - “java”) and the traditional national “Java”, corresponding to the traditional pronunciation of the name of the island of Java. Sun adheres to English pronunciation in all countries of the world. Sometimes the slang word “Toad” is also used in everyday life (for example, an image of a toad is on the calendar cards of the Russian Java Users Group).

Java object-oriented programming language

The Java programming language was developed by Sun Microsystems and is object-oriented. Source Java applications converted by the compiler javac into special bytecode for execution under control virtual java by car.

Virtual Java machine JVM (Java Virtual Machine) is a program that processes bytecode and passes instructions to the hardware as an interpreter. One of the main advantages this method program execution is completely independent from operating system and hardware, allowing you to run Java applications on any device for which a corresponding virtual machine exists.

Also important features of Java technology include a flexible security system, in which program execution is completely controlled by the virtual machine. Any actions that violate the program's permissions (for example, attempting unauthorized access to data or connecting to another computer) cause the program to immediately terminate.

The disadvantages of the concept of using a virtual machine include decreased performance, which can be combated in various ways:

  • the use of technology for translating bytecode into machine code directly while the program is running - JIT technology;
  • widespread use of platform-oriented code (native code) in standard libraries, for example S.W.T.;
  • hardware that provides accelerated bytecode processing, for example, Jazelle technology, supported by some ARM processors.

Java versions

Java 1.0

Java development began in 1990. The first one was released in 1996 official version- Java 1.0.

Java 1.2

The updated JDK 1.2 specification was developed in 1998 and was released under the name Java 2. The language remained virtually unchanged, but the platform received a number of additions:
  • Swing library for user interface development;
  • set of collections;
  • support for Policy files and digital certificates user;
  • Accessibility library;
  • Java 2D;
  • support for drag-and-drop technology;
  • Full Unicode support including Japanese, Chinese and Korean;
  • support for playing audio files of several formats;
  • JIT compiler.

Java 5.0

In 2004, the Java 5.0 specification was released. Since the development of this version, the official indexing has been changed; Instead of Java 1.5 it is more correct to call it Java 5.0. Sun's internal indexing remained unchanged - 1.x.

Minor changes are included without changing the indexing. The word “Update” is used for this, for example, Java Development Kit 5.0 Update 25. It is assumed that updates may include both bug fixes and small additions to the JVM virtual machine API.

In version Java 5.0 A number of fundamental additions were made:

  • enum types enum;
  • annotations - the ability to add metadata to the program text that does not affect the execution of the code, but can be used to obtain various information about the code and its execution;
  • methods with an indefinite number of parameters;
  • import of static fields and methods is allowed;
  • can be used in the collection Iterator objects ( foreach);
  • usage javadoc comments for automatic documentation;
  • generalized programming tools generics.

Java 6

Another release was released in December 2006 Java 6. Along with this release, changes were made to the official indexing - instead of Java 6.0, the version is listed as Java 6. Minor changes, as in previous version, are included in regular version updates, such as Java Standard Edition Development Kit 6 Update 25.

In version Java 6 The following major changes “noted” by the developers have been made:

  • OpenGL and DirectX performance has been improved in Swing;
  • added GifWriter for working with .gif files;
  • stream classes became available for reading and transmitting compressed data, with the ability to transmit them over the network;
  • archiving - restrictions on the number of files in the archive have been removed (previously 64 KB), the length of the file name has been increased (previously 256 characters)
  • restrictions on the number of people at one time have been lifted open files(previously it was 2000).
  • a cache management system has been organized and support for the “no-cache” parameter in the HTTP request has been added;
  • along with the already existing Gregorian and Buddhist calendars, support for the Japanese imperial calendar has been added;
  • you can use Java HTTP Server to create a complete HTTP servers with the minimum necessary functional properties;
  • The calculation speed and the speed of I/O operations have been increased.

Java 7

Version release release Java 7 took place in July 2011. Unfortunately in the final version Java Standard Edition 7 a number of previously planned changes were not included, which it was decided to add to Java Standard Edition 8.

IN new version, called Java Standard Edition 7, in addition to bug fixes, several innovations were introduced:

  • a new type verifier that works somewhat faster has been added, called the “typechecking verifier”;
  • interfaces for organizing a queue have been added to collections (data sets);
  • modification of the class loader (class-loader);
  • URLClassLoader - releasing the resources held by the classloader using the close() method;
  • JDBC updated to release 4.1, Rowset to version 1.1;
  • added new look-and-feel of the next generation;
  • nio.2 - new interfaces for accessing the file system, scalable asynchronous IO interaction, full work with zip/jar archives as file system;
  • support for Unicode 6.0 version;
  • generic - change the type inference when creating an object;
  • Locale - user and GUI locales are separated; text formatting and message display on screen have independent "locales".

Java 8

Version release release Java 8 took place in March 2014. List of innovations:

  • Full support for lambda expressions.
  • Keyword default in interfaces to support default functionality.
  • Links to methods.
  • Functional Interfaces(predicates, providers, etc.).
  • Streams for working with collections.
  • New API for working with dates.

Java Technologies

There are several main families of Java technologies:

TechnologyDescription
Java SE - Java Standard Edition Core Java technology including compilers, APIs, Java Runtime environment; used to create custom desktop applications.
Java EE - Java Enterprise Edition Technology for creating enterprise level software. Used for developing WEB applications.
Java ME - Java Micro Edition Technology for creating programs for devices with limited computing power, such as mobile phones.
JavaFX Creation technology graphical interfaces corporate applications and business.
Java Card Technology for creating programs for applications running on smart cards and other devices with very limited capacity.

Android Development Tools, Java for Android

Java actively used to create mobile applications for operating environment Android. In this case, programs are compiled into non-standard bytecode for use in virtual machine Dalvik. For such compilation it is used additional tool, developed by Google - Software Development Kit (SDK).

You can also develop applications in Android Studio, NetBeans or Eclipse using a plugin Android Development Tools (ADT) or in IntelliJ IDEA. The JDK version must be at least 5.0.



tell friends