THE JAVA LANGUAGE

DATA TYPE AND VARIABLES IN JAVA

DATA TYPE A Data Type is a classification that precisely specifies a homogeneous set of values and the operations that can be applied to these values. For example, if we take integers as the Data Type, that is, the set of those numbers that do not have a decimal part, the operations we can perform on this set of values are arithmetic operations. Although Java is an Object-Oriented programming language, it is critical to understand that not all values we can express in Java are realized as objects. PRIMITIVE TYPES AND REFERENCE TYPES Primitive types are [...]

By |2023-04-02T23:00:24+00:00April 2, 2023|0 Comments

INTRODUCTION TO JAVA

INTRODUCTION TO JAVA STRUCTURE OF JAVA PROGRAMS The minimum entities that we can represent within a Java program are Attributes and Methods, which are the basic components of an Object Oriented program. Both do not live a life of their own within a program written in Java but they must always be placed within a class definition. A class can be regarded as the basic logical and autonomous entity of the language. Attributes and methods are also known as class members. Members of a class are divided into instance members and class members. The definition of a class in [...]

By |2023-04-04T20:40:22+00:00March 19, 2023|0 Comments

THE BYTECODE AND THE JAVA VIRTUAL MACHINE

THE BYTECODE Bytecode is the product of the compilation phase in Java. The JVM is a virtual, software-described representation of a real computer. The JVM has a machine instruction set, like a regular CPU. The instruction set recognized by the JVM is called Bytecode. There are 256 instructions in the Java Virtual Machine in all, and each of these instructions occupies one byte. Hence the name Bytecode. Compiling a Java source using the Javac command produces a file with a .class extension that contains the Bytecode. To touch on what Bytecode actually looks like let's create [...]

By |2023-04-06T20:37:16+00:00April 6, 2023|0 Comments

THE JDK, JRE AND DEVELOPMENT ENVIRONMENTS

INSTALL JDK AND JRE THE JRE Java Runtime Environment: what it is and what it is used for. JRE is an implementation of the Java Virtual Machine and is necessary for the execution of programs written in Java. The Java Runtime Environment contains: the Java Virtual Machine (JVM) the standard Java API a launcher needed to launch programs already compiled in bytecode. What is not... Is not a software development environment does not contain development tools What does it contain? The JRE contains: java, javaw, libraries, rt.jar THE JDK JAVA DEVELOPMENT KIT: WHAT IS IT AND [...]

By |2023-03-20T19:51:06+00:00March 20, 2023|0 Comments

COURSE PROJECT STRUCTURE

YOUR FIRST JAVA PROJECT The goal is to create the first Java Project, using Visual Studio Code, to create what will be the structure of the programs that we will write as we go along. We will call the project CourseJava. I illustrate with a video the steps to be taken in the editor. I bring you a picture of the folder structure that the editor creates when a Java project is added. src source files, i.e., code files that we write and having the extension .java bin there are the files [...]

By |2023-03-25T23:46:48+00:00March 25, 2023|0 Comments

OPERATORS IN JAVA FIRST PART

OPERATORS IN JAVA An operator is a specific symbol in a programming language that allows a specific operation to be performed. An operator always acts on a set of elements called operands. In the example you can see the operator + which acts on two operands. As we shall see, it is possible to join several operators together; in these cases, precedence must be established among the operators. Precedence is a rule that some operators have priority over others. Then when we are in compound operations in which the operators have the same precedence associativity comes [...]

By |2023-04-11T18:54:11+00:00April 11, 2023|0 Comments

OPERATORS IN JAVA SECOND PART

OPERATORS IN JAVA THE COMPOUND ASSIGNMENT OPERATORS Let's start right away with an example. From the figure below you can see that we took the value of the variable x (10) we added 5 and assigned the result to the variable x. We see the contracted form alongside that has the same meaning. x+=5 -> x = x + 5 Compound assignment forms exist for all arithmetic operators: +=;-=;*=;/=;%= The use of these forms is very common in Java, so it is good to understand them early on. THE [...]

By |2023-04-13T22:52:34+00:00April 13, 2023|0 Comments

OPERATORS IN JAVA THIRD PARTY

THE CONDITIONAL OPERATOR Later in the course we will learn how to use conditional tests, that is, instructions that allow us to execute different blocks of code depending or not on the occurrence of certain conditions. The conditional operator although in a limited form enables us to achieve the same purpose. It is a ternary operator, that is, it uses three operands. exp1 is a boolean expression. If the expression exp1 returns true then the second expression is executed, otherwise if false exp3. Let's take an example. EXAMPLE TERNARY OPERATOR In the [...]

By |2023-04-15T08:58:31+00:00April 15, 2023|0 Comments

FLOW CONTROL IN JAVA FIRST PART

FLOW CONTROL INTRODUCTION Based on what we have learned so far, we know that the execution of a Java program occurs sequentially. In any software we are going to write there is a need to alter the normal flow of the program based on a number of conditions that occur. In this regard Java like all other programming languages provides us with some flow control instructions. A program always has its own execution path as we see in the figure. This is the simplest case, the program executes instructions one after the other in a top-down sequence, [...]

By |2023-04-18T23:17:07+00:00April 18, 2023|0 Comments

FLOW CONTROL IN JAVA SECOND PART

THE WHILE CYCLE Having examined conditional tests we will now go on to look at the flow control structures that belong to iterations. The image shows the general form of the while loop. The while loop repeats a series of lines of code until the condition specified in parentheses is true. The condition is evaluated immediately, that is, before the cycle starts. This has an important implication because if the first time the Boolean expression is evaluated it is false, the entire loop is not executed. The post increment instruction x++ is the one that allows [...]

By |2023-04-20T21:12:44+00:00April 20, 2023|0 Comments
Go to Top