lecture 01

 

WHAT IS JAVA?

            Java is a programming language, it is majorly an object-oriented and platform-independent language. Java was developed by James Gosling at sun microsystems in the year of 1995.

            -Java is an object-oriented programming language that makes solving complex problems easier.

IS JAVA USES INTERPRETER OR COMPILER?

            The java program(source code) will be compiled into a JBC(java byte code) using compiler, after that the code runs on the Java Virtual Machine which produces runtime environment using interpreter.so java uses both interpreter and compiler                               


 


 JVM is used to load, verify, execute the code and to provide the runtime environment.

à


Features of java:

1.    Object oriented

2.    Platform Independent

3.    Simple

4.    Architectural Neutral

5.    portable

6.    Secure

7.    Robust

8.    High performance

9.    Multithreaded

10.Distributed

11.Dynamic

12.Interpreted

first java program….!

                        Class Avn

{

Public static void main(String[] args);

    {

            System.out.println(“hello cse “);

    }

      }

-o/p:

            hello cse

 

NOTE :

            Java is case sensitive so be carefull while writing the program regarding capital and small alphabets.


àWHAT IS “import”?

          The import statement is used to bring certain classes or the entire packages, into visibility. As soon as imported, a class can be referred to directly by using only its name.

The import statement is a convenience to the programmer and is not technically needed to write complete Java program. If you are going to refer to some few dozen classes into your application, the import statement will save a lot of time and typing also.

àWHAT IS “public static void main(String[] args)”?

          public static void main(String[] args) defines the main() method. This is the starting point for the interpreter to begin the execution of the program.

Ø Public: it is an access specifier that declares the main method as unprotected and making it accessible to all other classes.

Ø Static: the main must be declared as static since the interpreter uses this method before any objects are created.

Ø Void: void states that the main method doesnot return any value.

 

àWHAT IS “System.out.println” ?

          Java is purely an object oriented programming language, every method must be part of an object. The println method is a member of the out object, which is a static data member of System class. The println always appends a newline(i.e., the output will start on a newline).


                                                               

0 Comments

Types of Arrays in C Programming | Lecture 10

In C programming, arrays are a fundamental concept that allows you to store multiple values of the same data type in a single variable. Instead of using multiple variables to store similar data, arrays make it easier to manage and manipulate these values. Types of Arrays There are two main types of arrays in C: One-Dimensional Arrays Multi-Dimensional Arrays One-Dimensional Arrays A one-dimensional array is like a list where all the elements are stored in a single row or column. It uses only one subscript to access each element. Declaration: DataType variable_name[size]; Here, DataType is the type of elements (e.g., int , float ), variable_name is the name of the array, and size is the number of elements the array can hold. Example: Declaring an integer array with 5 elements: int number[5]; This array can store 5 integers, with indices ranging from 0 to 4. Initialization of One-Dimensional Arrays Arrays can be initialized at the time of...