Introduction of java ? What is Java? How to run java programm?

                  Introduction of   java

1.    What Is Java?

·         Java is a high-level, third-generation programming language .created in 1995  by “Jamesh Gosling”.

2.    What is the Full form of OOPs?

·         OOPs:- OOPs is a Programming Paradigm | Methodology.  Paradigm can also be termed as a method to solve some problem or do some task. A programming paradigm is a language or also we can say it is a method to solve a problem using tools and techniques that are available.

 

·         Programming Paradigm:-

                     i.            Object-Oriented Paradigm

                   ii.            Procedural Paradigm

                  iii.            Functional Paradigm

                 iv.            Logical Paradigm

                   v.            Stractural Paradigm

 

v OPPs Main Pillers:-

A.      Class

B.      Object And Method

C.      Inheritance

D.      Polymorphism.

E.       Abstraction

F.       Encapsulation

 

3.       Who are the purely Object-Oriented Programming Language?

·         [ SmallTalk ] is a pure object-oriented programming language truly.

 

v  JDK:-  [JAVA DEVELOPMENT KIT ] java development kit contains tools needed to develop the java program.

This tools could be compailer [ javac (classname).exe] application  luncher [javac   .exe] etc..

 

v             JRE:-    [ JAVA RUNTIME ENVIRMONENT] java runtime environment are contains JVM  [java package class] (java library

v            JVM:-  [java virtual machine] JVM is a platform-dependent JVM that provides a platform-independent executing code  

         JVM  interprets the byte code into machine code depending upon the underline operation system and hardware combination.




4.       What is different between compiler & iterative?

                  Compiler

                            iterative

 

The compiler is fast.

Iterative is slow

 

5.       What is data type?



 

6.       What is a variable?

·         It is a container that can contain any value.

·         EXAMPLE:-



 

7.       Java program can be possible without the main method?

·         It is possible to compile a java program without a main method, provided that class is used as a superclass. However, the program will execute only when there is a valid main method in the classes.

 

8.       Why is java architecture-neutral?

·         To enable a Java application to execute anywhere on the network. The compiler generators an architecture-neutral object file format –the compiled code is executable on many processors given the presence of the java runtime system .this is useful not only for networks but also for single system software distribution.

 

9.       What are the order of precedence and associativity?

·         Order of precedence the order in which operators are evaluated in expressions.                                                      associativity determines whether an expression is evaluated left-right-left.

 

10.   What is JVM? Why java is called [platform independent language]?

                                                              Or

11.   Why is java known as a platform-neutral language?

·         Part1:-  java virtual machine (JVM) is the heart of java programming language. JVM is responsible for converting byte code into machine-readable code.  JVM is not platform-independent, that’s why you have different JVM for the different operating systems. we can customize JVM with java options .such as allocating minimum and maximum memory to JVM .it is called virtual because it provides an interface that does not depend on the underlying operating system.

·         Part 2:- java is platform-independent because code is compiled into an intermediate language .called ”bytecode”, which is then compiled into native machine code on the system that supports Java can run any java application.

12. state why public, static, void, and String[] args is used in “public static void main(String args[])?

·         Public:- is an access modifier, which defines who can access this method public  means that this method will be accessible by any class (if other classes can access this class)

·         Static:- is a keyword that identifiers the class-related things. This means the given methods or variable is not instance-related but class-related. it can be accessed without creating an instance of a class.

·         Void:- is used to define the return type of the method. It defines what the method can return void means the method will not return any value.

·         Main:- is the name of the method this method name is searched by JVM as a string point for an application with a particular signature only.

·         (String args[]):- is the parameter of the main method.

 

Ø  Type of java variable and its value:-

 

                    I.            Int:- 1

                  II.            Float:-  1.1f

                III.            Double:--   11.11D

                IV.            Long:--  111111L

                  V.            Char:-  ‘ R ’

                VI.            String:- “programmingKhata”

 

v  Sample program of java:-


  

Note: -open cmd (commend protomer)on your computer  and compile and run then initialize

Output:-  javac Sample.java

                Java Sample

     -Programming khata-



Output:-  javac Sample.java

                Java Sample

     -(the sum vslue of  xand y:= 15)-

 

Post a Comment

0 Comments