Showing posts with label Types. Show all posts
Showing posts with label Types. Show all posts

Use constants rather than numbers - declaring variables with FINAL statement


Suppose the government hired you to create an application that, among other things, examines whether a citizen is adulthood or not.
How would you do this conditional test?

if (age> = 21) or who knows ... if (age > 20)?

Both correct, but absolutely not recommended.
In this article we will teach an important lesson in Java: Do not use numbers, but constant.

Flux Control


Loopings, Flux and Statements Control

01. How to use IF and ELSE: Testing and Controlling which will run
    Application: Say if you got straight approval, or have to do recovery test or failed
    Application: Determines the roots of a second degree equation
    Video lesson: Java Video lesson - How to use the conditional test IF ELSE
02. Questions about IF ELSE use
03. Math Operators Increment (++) and Decrement (--)
04. Assignment Operators: +=, -=, *=, /= and %=
05. Assignment operators and increment and decrement: differences between a=b++ and a=++b
06. The while loop: what it is, how to use and calculating AP and GP series with while
07. Infinite loop, controlling loops and loops with while statement
    7.1 Exercises about the while looping
08. Control Statement for: having better control over repetitions
    8.1 Exercises about control statement for
09. The do while loop: the control statement that always happens..at least once
10. The break and continue commands: interrupting and changing flows and loops
11. switch command: makind choices in Java
12. Problems involving control statement: if, else, while, for, do while and switch
      Exercise: Program that says how many days the month has
      Video lesson: using loop and control statements WHILE, FOR, DO WHILE and SWITCH

Game: How to program the Battleship game in Java

Basic Topics in Java Programming

 Basic Topics in Java Programming


    01. The necessary to start programming: installing JDK and NetBeans
    02. Creating the first program in Java
       2.1 Commented code of the first program - what Classes and Methods are
    03. Printing on screen using print, println and printf
       3.1 Exercises about printing outputs
    04. Comments and Delimiters
    05. Numeric Types - byte, short, int, long, float and double
    06. Getting user data: class Scanner
          Video lesson: How to use the Scanner Class
    07. Math: Addition, Subtraction, Multiplication, Division, Division Rest (module) and operator precedence in Java
    08. Comparisons: operators greater than (>), less than (<), greater equal (>=), less equal (<=), equal (==) and different (=)
    09. Char type: storing and representing characters
    10. Boolean type: the Base of Computer Logic
    11. The logical operators and denial: && (AND), || (OR) and! (negation)

    Java, the boolean type: the Base of Computer Logic


    Is a Boolean data type that allows only two values, true or false.

    Java, programming, computing, two binary values ​​...?

    Yes, it has to do with something more complex, Boolean Algebra (binary numbers and logic), which is the basis of all Electrical Engineering, Electronics and Telecommunications, for example.

    Java, type char: storing and representing characters

    The data type char is used to store one character (the char comes from character), and for this simple function has the size of type short.

    Naturally the question comes to that store just one character?
    If there are types for storing numbers, strings and texts, what do we do with a character?

    Where do we use the char type?

    Java: Numeric Types - byte, short, int, long, float and double




    We already know how to show messages through the 'print'.
    Now let's do some stuff with numbers.

    We will show you how to work with integers and real numbers (decimal), in addition to an explanation about data types (int, float and double, in this case).