#club75 - Java Programming class || Class, Object, Method and Functions
Good morning dear friends, I am glad we all were opportuned to see today, to God be all glory. So as promised I will formally start my Programming class today, I will try explain in the simplest formate possible. Hope you enjoy it.
Below is today course outline I will try to cover today.
✓ Programming vs web development
✓ Class, Object, Method and Functions
✓Datatypes and Variables
°Primitive Datatypes
°Declarations
°Variable Names
°Numeric Literals
°Character Literals
°String
°Arrays
°Non-Primitive Datatypes
What is Class, Object, Method and Functions
Class and Object: A Class can be easily define as blueprint or template for creating Object. Object on the other hand is easily mostly known as the instance of the class Class mostly seen or used in Object Oriented programming. For easy understanding just know that object oriented programming is easy in the sense that it works as any real life object. For example take a class as a boy, every class has an object and just as every boy has a his own unique characteristics. Another example, using a car as the class, a car has characteristics like seats, wheels, brakes, steering etc, with its behavior which is mobility is the method. This is the basic concept behind Class, object and method.
Method and Function: As explained before method are set of procedures in a class, that's is to say it's the step by step action or activities that goes on to produce an output. These method can't stand alone the are always found in a class. Function are also procedures, Some programmers would say the are same with different just little difference. Function can be easily said to be a set of reusable programming codes that can be called anything or anywhere they are needed, this saves the programer the time and stress taken to rewrite the code. I'm other words functions are reusable method.
Datatypes and Variables
Variables are known as storage medium that stores value (integers, Characters, and boolean type) depending on the Datatypes assigned by the programmer for example:
Age=60;
Age is the variables and 60 is the value, any where age is called or added 60 is automatically added.
Datatypes: As the names implies it's is usually Used to signify the type of data assigned to a variable. There are two types of datatypes in Java, we hare Primitive And Non-primitive.
Primitive datatype
Primitive datatype are fundamental data type that stores the data of only one specific data type
Types of primitive data type
Datatype | Size | Range of numbers been stored |
---|---|---|
byte | 1 byte | -128 to 127 |
short | 2 byte | -32,768 to 32,767 |
int | 4 bytes | -2,147,483,648 to 2,147,483,647 |
long | 8 bytes | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
float | 4 bytes | Stores fractional numbers from 6 to 7 decimal place |
double | 8 bytes | Stores fractional numbers up to 15 decimal place |
boolean | 1 bit | true or false values |
char | 2 bytes | single character and ASCII values |
Note: Byte, short, long and int can only store whole numbers.
Float and double only stores fractional numbers
Char stores only characters like alphabet.
Boolean only Either True or False.
Non primitive
Non-primitive data types are data type which is a user-defined and can store the data of different types in a single entity.
Types of primitive
✓Array
✓String
Difference between primitive data type and non-primitive data types.
Primitive datatype | Non-primitive datatype |
---|---|
°Primitive types are predefined in Java | °Non-primitive types are created by the programmer and is not defined by Java. |
°Primitive is the fundamental data type | ° Non-primitive datatype is a derived datatype. |
°Primitive types cannot be used to call method | °Non-Primitive types can be used to call methods to perform certain operations . |
°A primitive type must always has a value, | °Non-primitive types can be null. |
°A primitive type can starts with a lowercase Alphabet | °Non-primitive datatype starts with an uppercase letter. |
°The size of a primitive type depends on the data type | °Non-primitive types have all the same size. |
Arrays: Arrays are mostly used to store to store multiple values in a single variable
For example
✓int[] Boys = {Dan, Steve, John, Emma};
✓
There are also used to create an a matrix
Arrays is a very large topic so I will stop here for now, so you don't get confused and continue tomorrow, believing you will settle down to accumulate all I have taught. Feel free to drop your questions below 👇.
Thanks for going through today's lecture hoping to see you guys tomorrow.
@steemcurator01
@preye2
@chiabertrand
@dayograpics
Wooow beautiful, original and high quality lessons on programming. I see you have put in a lot of time and efforts in this lessons
Thanks for sharing this valuable lessons with us
Thanks bro, I Am glad you find it educating and valuable.
Upvoted! Thank you for supporting witness @jswit.
Please check my new project, STEEM.NFT. Thank you!
Thank you very much dear witness
Note: You must enter the tag #fintech among the first 4 tags for your post to be reviewed.
I must really commend your lecture on Java Programming, you have taught us really well and my knowledge on programming have increased. Thanks for your lecture sir.
Get programming assignment assistance from the experts at: https://studentlifesaviour.com
Australian Assignment Help is the best provider of assignments in all subjects including programming subject at: https://australianassignmenthelp.com