Skip to main content

Featured

7. Executing our First Java Program in BlueJ | Java Programming | Compiling and Creating java Program @techcomputergyaan Technical Magic

 Executing our First Java Program in BlueJ  We are going to discuss Comments in Java Comments: Text ignored by the compiler To write some notes for future reference To find some errors we can make some statement as comment and can compile the program and in this way we can find errors in the program. Way of writing Comments // for single line comment /* for multiple line comments */ Create our First Project in BlueJ Step 1: To open BlueJ Step 2: Create new project Step 3: Create New Class in Pascal case, I have created HelloJava Step 4: Double click on HelloJava class. A new window in BlueJ with some codes will open. You will see some comments and some codes written over here. So, I am going to delete everything and I will write only codes which is important for our first program. So, here in the above screenshot you can see I have deleted everything except our HelloJava class. Now we will write code for our main() method. Now in the main method we can write our statement. Wri...

2. Programs and Programming Language | Java Programming Language | High Level | Assembly Language | Machine Language | @techcomputergyaan

 Programs and Programming Language

We are discussing

What are programs and Programming Language

    Program (Software)

        Set of instruction that tell a computer or computer system what to do

Instruction: Set of Data.
Data: Data is the collection of information.
  • We use programs to interact/talk with computers
  • To write programs we use programming languages

    Programming Language

        Languages used to write programs

  • Computers are machines.
    • They do not understand human languages
  • Programs are written in a language that a computer can understand.
    • Programming language

Machine language

    A computer's own language

  • Binary Language: Combination of two digits i.e. (0 & 1). 
  • It is machine dependent. It's instruction is different for different machines.
  • Instructions are hard to understand and learn. As to add two nos. 2 & 3 we need to write 1101100101101101
Points to remember
  • Every instruction should be written in machine language before it can be executed.
    • We can say all instructions written in other programming languages must be translated to machine code instructions.

Assembly language

    It was developed to make programming Easier

  • Machine dependent
  • Introduced keywords (mnemonics) like add, sub,...
  • To add 2 &3 and get the result: add 2, 3, result
  • It can not be executed directly.
  • A program called Assembler translates assembly codes to machine code.

    Assembler

High Level Language

    A new generation of programming language

  • Uses English words | easy to learn and use.
  • Machine independent | one program can run on different machines.
  • Here instructions are called statement.
  • A program written in a high-level language is called a 'source program' or 'source code'.
  • To add 2 & 3 and get the result : result = 2 + 3; (just like mathematical instruction).
  • Here we use a 'Compiler' or an 'interpreter' to translate source code (source program) to machine code.

Compiler

    Translates all the source code into machine code
Source Program -> Executable
Source code - Compiler -> Machine Code - Executor -> Output

Interpreter

    Translates each statement into machine code and executes it.
Statement - Interpreter -> Output

Comments

Popular Posts