A blog for computer science passionates.

Thursday, 20 February 2020

Hello Friends!!!
Today we are going to learn the example of datatypes. Please refer to Datatypes to get all the details of Java Datatypes.

Let's start with What is variable?
Variable (scalar) is a named memory location (Name given by a programmer or developer to identify that memory location for their purpose is also known as Identifier) we can store a value to a variable it is temporary storage for a value.

In Java, we can define a variable with its type. Here is how to declare a variable?
<data_type> <var1>,<var2>,<var3>;

For Example,
int employee_id, length;

Even we can assign a value to the variable such as,
<data_type> <var1>=<val1>,<var2>=<val2>;

For Example,
int employee_id=123,length=5;

Now let's take a demo class to define a variable with different data types.

Here is the output of the above example,
Fig. The output of the above example
This is the simple example of data types, that shows how to define variables with different data types and how to assign values and how to access values from the variable.

Here, in long and float data type we need to add L or l or F or f after values so that values can be considered as long or float otherwise it is considered as integer or double value.
In float datatype, if we don't write f or F, it shows an error.
float f1=45.567;    //if we write this line, it generates below error.
 
Fig. An Error for float data type
This is an example of Data Tyes of Java. In the next article, we will learn something new in Java.
Till then that's it, Happy Coding...☺😊

Sunday, 16 February 2020

Hello Friends!!!

This is the third algorithm, here I am going to share the support vector machine one more classification algorithm there are more classification algorithms I recommend you to refer these articles Logistic Regression and Naive Bayes classifiers to get proper ideas about classification algorithms.

SVM is really a very simple algorithm that works more accurately with less computational work. Actually, the support vector machine is a model works on a supervised learning technique, it works on both regression and classification. And generally suitable for binary classification. SVM is used to separate N - Dim hyperplane. For Example, if we have labeled data such as an image is a cat or not a cat. Here, we have two different labels Cat and Not and SVM Separates these labels on a hyperplane.
Fig. SVM Separates Labels


The above figure shows that the SVM separates the 2D hyperplane. In the above example, we have two labels blue dots represent Cat label and the orange triangle represents Not a Cat label. And in the above figure, one can see the separation of two different labels.

So, That's it you can get easily what is the meaning of Support Vector Machine? In the next article, we will learn more about SVM.

Tuesday, 11 February 2020

Hello Friends!!!

In this article, we are going to learn different data types in Java. Java is a strongly (Strict) typed programming language. i.e. all the variables or expressions must have data types as Java compiler checks whether the variable or expression is compatible with data or not. There are two different types:
  • Primitive
  • Non - Primitive
Primitive Data Types: In simple words, primitive data types mean primary data types, as we all know that we have different data such as numeric data or a character type of data based on the types of data Java defines different data types. such as integer, float, long, short, byte, double, character and boolean.

Non-Primitive Data Types: These data types works on arrays, string or class or interfaces, etc. generally, non-primitive datatypes made with primary (primitive) data types.


Data type
Range
Size (Bits)
Group
byte
–128 to 127
8
Integer
short
–32,768 to 32,767
16
Integer
int
–2,147,483,648 to 2,147,483,647
32
Integer
long
–9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
64
Integer
float
1.4e–045 to 3.4e+038 (Approx)
32
Floating Point
double
4.9e–324 to 1.8e+308 (Approx)
64
Floating point
char
0 to 65,536
(\u0000 to \uFFFF)
16
Character
boolean
true / false
1
Boolean


Table.1 Primitive Datatypes

Java supports eight different primary data types with four different groups as you can see in the table. In the next article, we will learn more about data types i.e. how to work on these data types? till then enjoy Java and start with Hello World Coding.
Happy Coding...☺