Hello ! Guys. Welcome to "STAR CODE LEARNING".
In this tutorial we have to learn about "JAVA programming " from Basics to Advanced.
It helps a lot to improve our programming knowledge and write code as our own.
Let's start the session:
Let start from the Agenda of the Basic Java Programming.
1. Installation of Java
2. Installation of Eclipse
3. Data types in java
4. Data conversion
5. Arrays in java
6. Operators in java
7. Control statements
8. Data structures in java
9. Loops in java
10.Java streams
11. Java access modifiers
12. Java collections
13. Inheritance
14. Encapsulation
15. Abstract classes
16. Interface
17. Polymorphism
18. Static keyword
19. Expectations in java
20.Calculator( based on core java concepts )
Installation of JAVA JDK:
1.Insatllation of Java
We have to install the java programming on our systems for that we have to install the download the "JAVA JDK".
Step 1 : Go to chrome search for "jdk java download ".Go to the first link which is from oracle site.
Step 2 : Click on that oracle website. We have a "java SE downloads"page. IN that page we will see different versions of java, like java se 15, java se 14 and all previous versions of java.
Step 3 : Go to java se 15. Click on JDK download. It brings upto the downloads detaileed page. Choose your platform for your using system.
Step 4 : Click on that link which you want to your system. A page is apperead, in that, they ask which you want oracle technology license agreement.
Click on check box and also click on download. The file is downloading.It will saw in your systems.
NOTE : You want to change the location of java jdk in your system.For that:
Step 5 : Open that file ,give permissions amd agree/accept/next/yes option. And extract your java , which place you want in your system.
NOTE : Open java they ask a programm for your system , just type java-versin and press enter. They show a version of java are tou installed in your system.
That's enough.Your java jdk are successfully installed in your system.
Installation of eclipse:
2. Installation of Eclipse
If your are not interested to install java jdk ,For that you would also install the Eclipse.
Step 1 : Go to browser, search for "Eclipse download".Result for your searched as showned in your system. A new page is opened.
Step 2 : Click on frist link from " eclipse foundation" . It goes to a new page. You would see bunch of options for that. A default option is highlighted , which would be a eclipse installer.Press on download option.
Step 3 : It goes to a new page. Based on your location it is going to suggest the nearest possible mirror location. Click on that particular download button. It will be downloading.
Step 4 : After downloaded the eclipse.Double click on that eclipse .It shows different options , choose "ECLIPSE IDE for Enterprise Java Developers.
Step 5 : Click onn install.It installing, once the installation is completed just hit the lanch button.
Your Eclipse is installed successfully. Select the workpalce which you want to paste that Eclipse
3. Data types in Java
Data types are two types ; They are:
Premitive data types and
Non -Premitive data types.
First we know the difference betweeen premitive and non-premitive data types.
Premitive data type are once which are default supported by java.
Non-Premitive data type are obaticustom in nature. Were you as developer as a liberty to define the nature of the data type.
* Premitive data type:
A premitive data typew is predefined by the language and is normed by a reserved keyword. Primitive valuees do not share state with other primitive values. The eight premitive dataq types are supportes by the java programing language are :
. Byte
. Short
. Int
. Long
. Float
. Double
. Boolean
. Char
Byte data type:
The bite data type is an 8-bit signed two's complement integer.
-128 to +127 is the value of an bite data type.
This data tyoe can be useful for saving memory in large arrays, where the memory savings actuaally matters .
They can also be useed in place of int where therir limits helps to clarify your code.
Fact that a variable's range is limited can serve as a form of documentation.
Short data type:
It is 16-bit data type.
-32,768 to +32,767 is the value of this daat type.
It useful to save the memory in lareg arrays.
Int data type:
it is a 32-bit data type.
(-2^31) to +(2^31)-1 is the values for this data tyope.
It has static methods like compare Unsigned, divede Unsigned etc. have been added to the integer class to support the arthimetic operations for Unsinged integers.
Long data type:
It is a 64-bit data type.
(-2^63) to +(2^63)-1 id the value for ths data type.
Use this data type when you need a range of valuees wider than those provided bi int.
It has a methods like compare Unsigned, divide Unsigned etc. to suppoet arthimetic ooperations for unsigned long.
Float data type:
This is a Single-Precision 32-bit IEEE 754 floating point.
It is specified in the floating-point types,foramts, and values section of the java language specifications.
This data types never be used for precise values, such as curerncy.
Double data type:
It is also double-precision 64-bit IEEE 754 floating point.
It is also a specified in the floating-point types,formats,and values section of the java programming specifiaction.
For the decimal values, thuis data type is generally the default choice.
It is also never used for precise values.
Boolean data type:
The boolean data type has only two possible values like true/false.
This data type is simple flog of true/false conditions.
Represents one bit of information.
It's size is not precise ddefenied.
Char data type:
It is a single 16-bit unicode character.
It has a value of \uoooo to \uffff (or 65,535 incluisve).
Example for premitive data type:
public class primitive Data Tpes
{
public static void main(string args[])
{
char a = 'A';
bytee b = 4;
short c = 11;
int d = 10;
float e = 7.835536f;
double f = 6.53827489364d;
boolean g = false;
system.out.println("char:"+a);
system.out.println("bytee:"+b);
sytem.out.println("short:"+c);
system.out.println("iint:"+d);
sytem.out.println("float:"+e);
system.out.println("double:"+f);
system.out.println("boolean:"+g);
}
}
output:
char:A
bytee:4
short:11
iint:10
float:7.835536
double:6.53827489364
boolean:false
*Non-Premitive data types
In no-premitive data types we can discuss about string in no-premitive data type.
It is very derivatable in java community to call string as the non-preimitive data type.
In the technical way, string is a special data type.
neither fully lies in premitive category nor fully lies in non-premitive category.
I conclude it an non-premitive data type because,java providing native support to string handling in JDK.
String can store a continous sequence of characters,technically string is basically an character array.
Example:
1 public class Non Premitive Data Type {
2 public static void main(stirng []){
3 String str = "test";
4 system.out.println("strin is :"+str);
5 string str 1 = new string ("test");
6 system.out.println("Another string:" +str);
7 int arr[];
8 arr=new int[2];
9 arr[0]
10 arr[1];
11 arr[2];
12 system.out.println(arr);
13 system.out.println(arr[2]);
}
}
output:
string is : test
Another String ; test
2
Explanation:
Strings can be created multiple way in java.
From above program we can divide that into parts
# line 3 and line 4 are one type of string.
# line 5 and line 6 are another type of string.
# Array ia an non-premitive data type in java.And array can be a continuous sequence of anything.
Java First program :
First program in java
package test program 1 ;
public class Test Hello World {
public static void main(string arg[]) {
system.out.println("Hello World! :") ;
}
}
OUTPUT:
Hello World!
Explanation:
System.out.println= it is used to print anything you want to print.
public class, public static void main etc.these are all key words in java.
Println= print words in line by line.
Print = print words in a line only.
Remember that java is a k sensitive language.
k sensitive = the word which have capital letters or small letters , they have to follow their letters rule.
Tap next button for next topic
4 Comments
Good job.
ReplyDeleteThanks for your response . If You need any course comment below
DeleteIt's easily accessible and good info
ReplyDeleteThe article of the java is easy and simple to understand.
ReplyDeleteI like the article of java, i'm learning java for your article.