#java #javatutorials #deepak #smartprogramming
Java Development Course (Upto 80% off) : https://courses.smartprogramming.in
For more details Call or What's App : +91 98887-55565
-----------------------------------------------------------------
https://youtube.com/playlist?list=PLlhM4lkb2sEhfuXL-2BDrJ67WkUdQ2v9b : Core Java Playlist
https://youtube.com/playlist?list=PLlhM4lkb2sEjVsbbZ_kiixY5CcR84IQUg : Advance Java Playlist
https://youtube.com/playlist?list=PLlhM4lkb2sEhdllbTIVF0rzD0coCiuHok : Android Playlist
=====================================
▶ Core Java Chapter-wise Playlist ◀
⭕ 9. https://youtube.com/playlist?list=PLlhM4lkb2sEiOcuH1g-CUuU288qmMNpyj
⭕ 8. https://youtube.com/playlist?list=PLlhM4lkb2sEh1pBs0KBb63PlKKqRx6M1a
⭕ 7. https://youtube.com/playlist?list=PLlhM4lkb2sEh8AARH5oEivYOrMgaVsPFb
⭕ 6. https://youtube.com/playlist?list=PLlhM4lkb2sEjaU-JAASDG4Tdwpf-JFARN
⭕ 5. https://youtube.com/playlist?list=PLlhM4lkb2sEhf5NlWeYh_gdcN49pHjVP0
⭕ 4. https://youtube.com/playlist?list=PLlhM4lkb2sEi4UoqSmobDeA5VNI1f2w3C
⭕ 3. https://youtube.com/playlist?list=PLlhM4lkb2sEgQmNKO43i7v60no4bdc3lI
⭕ 2. https://youtube.com/playlist?list=PLlhM4lkb2sEj6zsK25K9f15qNUATqYxGq
⭕ 1. https://youtube.com/playlist?list=PLlhM4lkb2sEhwPZhFmlox57kaCgMm5UgC
=====================================
▶Advance Java Chapter-wise Playlist ◀
⭕ 1. https://youtube.com/playlist?list=PLlhM4lkb2sEjDXBqaYbwAoDAQKh2yczR7
⭕ 2. https://youtube.com/playlist?list=PLlhM4lkb2sEiiEAP0uSFXiFY8KdXPnN0f
=====================================
Follow Me On Social Media :-
► Website : https://www.smartprogramming.in
► Instagram : https://www.instagram.com/smart_programming
► Facebook : https://www.facebook.com/smartprogramming.india
=====================================
SIMPLE JAVA HELLO PROGRAM :-
class Abc
{
public static void main(String[] args)
{
System.out.println("hello");
}
}
=======================================
EXPLANATION OF EACH TERM IN ABOVE PROGRAM :
class :
- class is a keyword.
- Java is an object oriented programming and you cannot run your code without
a class in Java. So you need to put your code inside a class.
- In one java program, there can be only single public class.
- Syntax of class :
access-modifier class ClassName
{
//body
}
- If a class has no modifier (the default, also known as package-private), it is visible
only within its own package (you will learn about them in a later episodes)
------
Abc :
- Abc is an Identifier (user-defined class name)
- Class-name should follow the rules of an identifier.
------
public :
- public is access modifier keyword.
- JVM can be installed anywhere i.e. C or D or any other drive and JVM is
responsible to call main method which may be in any other drive, thus to
call main method by JVM from anywhere, “main” method should be declared
public.
-----
static :
- static is keyword.
- At the time of execution there is no object, thus by declaring main method
as static, it becomes class level method (not object level method), so it can
be called without object (JVM class main method). Thus main method
no where related to object.
-----
void :
- void is return type keyword.
- void means nothing or empty.
- main method has void return type as it does not return anything to JVM.
If it returns then what will JVM do with the value, it will be of no use.
------
main() :
- main is predefined method, which is configured inside JVM.
- JVM always start its execution from main method.
-------
String[] args :
- command-line arguments
-------
System :
- Predefined class present in “java.lang” package.
------
out :
- out is a “static variable”of “PrintStream” class present in “System” class.
Three static variables of PrintStram class are :
- out (for output)
- in (for input)
- err (for error)
----------
println() :
- println() is method of PrintStram class.
- Three different methods of PrintStream class to print on console are :
- print()
- println()
- printf()
==
WHAT CHANGES ARE ACCEPTABLE FOR "main()" METHOD :
1. The order of modifiers can be changed, so instead of “public static” we can write
“static public”.
2. We can declare “String[] args” in any acceptable form, which are given below :-
- String[] args
- String []args
- String args[]
3. Instead of “args” we can write any valid java identifier.
4. We can replace “String[] args” with varargs (Variable Arguments) parameter i.e. we can write “String... args”.
5. We can use “final”, “synchronized” and “strictfp” modifiers with main method