Batch 25 Notes
Batch 25 Notes
com
29-August-23
------------
A language is a communication media.
1) Syntax (Rules)
2) Semantics (Structure OR Meaning)
He is a boy. (Valid)
He is a box. (Invalid)
Note :-
Syntax of the programming language is taken care by compiler.
compiler generates errors if a user does not follow the syntax of the programming
language.
Semantics is taken care by our runtime Environment. It generates Exception if a user does
not follow the semantics.
-------------------------------------------------------------------------
30-Aug-23
----------
What is the difference between statically(strongly) typed language and Dynamically
(loosly) typed language?
In these languages we can hold different kind of value during the execution of the
program.
Ex:- Visual Basic, Javascript, Python
-------------------------------------------------------------------------
Flavors Of JAVA language :
------------------------------
1) JSE (Java Standard Edition) ->J2SE -> Core Java
As a developer we should always suggest stand alone application to our client, if the
client data is private or if we want to upload the data in the website then we need to
provide a separate username and password to each and every client.
2) Easy understanding :- Once we divide the bigger task into number of smaller tasks then
it is easy to understand the entire code.
4) Easy Debugging :- Debugging means finding the errors, With function It is easy to find
out the errors because each module is independent with another module.
Eg:-
Java code :
-------------
a) Java programs must be saved having extension .java
d) This .class file we submit to JVM for execution prupose (for executing my java code)
JVM :- It stands for Java Virtual Machine. It is a software in the form of interpreter
written in 'C' language.
Every browser contains JVM, Those browsers are known as JEB (Java Enabled Browsers)
browsers.
-------------------------------------------------------------------------
That is the reason C and C++ programs are not suitable for website development.
Where as on the other hand java is a platform independent language. Whenever we write a
java program, the extension of java program must be .java. Now this .java file we submit
to java compiler (javac) for compilation process. After successful compilation the
compiler will generate a very special machine code file i.e .class file (also known as
bytecode). Now this .class file we submit to JVM for execution purpose.
The role of JVM is to load and execute the .class file. Here JVM plays a major role
because It converts the .class file into appropriate machine code instruction (Operating
System format) so java becomes platform independent language and it is highly suitable for
website development.
Note :- We have different JVM for different Operating System that means JVM is platform
dependent technology where as Java is platform Independent technology.
-----------------------------------------------------------------------
01-Sep-23
---------
What is the difference between the bit code and byte code.
------------------------------------------------------------------
Bit code is directly understood by Operating System but on the other hand byte code is
understood by JVM, JVM is going to convert this byte code into machine understandable
format (Operating System format).
-----------------------------------------------------------------------
Comments in JAVA :-
------------------
Comments in JAVA :-
------------------------
Comments are used to increase the readability of the program. It is ignored by the
compiler.
In java we have 3 types of comments
/**
Name of the Project : Online Shopping
Date created :- 12-12-2021
Last Modified - 16-01-2022
Author :- Ravishankar
Modules : - 10 Modules
*/
----------------------------------------------------------------------
Write a program in java to display welcome message :
----------------------------------------------------
public class Welcome
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
If main method is not declared as public then program will compile but it will not be
executed by JVM.
Note :- From java compiler point of view there is no rule to declare our methods as
public.
---------------------------------------------------------------------