My Experience while learning Programming Java
November 29, 2021
Since it is pretty challenging to learn any thing so called programming language was bit bitter taste for me for the first time back in 2008 when I just started coding those days.
Although my first known programming language was BASIC where I used to create a very simple but still delightful program that was Multiplication Table for 2, 3 and so on. But its all about your hard work which approach to good things. After learning many years to understand and use of keyword, delimiter, methods, variable, OOPS concept, Object, API and other concept and design put me into this Java Programming world to build and deploy a new application.
So, my effort always will be to make Java as easy learning and understanding programming language to anyone who is trying to crawl in High Level Programming Language.
Few below are my free time effort to make something more simple rather than complicated videos and post that I know. So I am trying to keep everything as simple as ABC. Hope you will like and follow the video and please don't forget to visit my Survey Link where you can answer what you like about this Blog.
https://docs.google.com/forms/d/1BC6KYNXGb-pPoJMWo0j3FJJH8KLm63pZz949l20DcCE/viewform?edit_requested=true
I have just posted a very simple if else conditional statement videos here. Its again this videos is completely target to Beginner so its only way and concept to use if else statements.
Syntax for if else is as under:
if(condition){
// your code goes here
}else{
//when if condition doesn't work else will be enable and your code or statement goes here
}
Syntax for For as well as While loop is as under:
for( data type with variable declare; variable limit; variable increment or decrement){
//Some Code
}
initialize and declare variable;
while(condition){
//Some Code
variable increment or decrement;
}
May 16 2022
I am happy to be back with the new topic called interface and using Inheritance and Polymorphism concept today. we are creating two classes name SuperClass.java and MyClass.java which have main method on it. While explaining more about the code it's always good to clear with guideline and concept of the topic that will be posting. So lets briefly jump to interface with inheritance and polymorphism.
Inheritance: Since in Java been OOPS concept. We always try to minimize the code reuse the code that is already exist in other class. While the code that we used from other class become Super Class after borrowing there code and the class who borrowed the code to use it in its own class becomes Sub Class or Child class. The keyword to access the inheritance into the other class is "extends". Similarly there are four different ways we can consider the Inheritance 1) Single Inheritance 2) Multi-level Inheritance 3) Hierarchical Inheritance 4) Hybrid Inheritance .
We can define polymorphism as the ability of a message to be displayed in more than one form using the compile time and runtime accessibility called message overloading and message overriding.
Interface is nothing but the abstract which hold all the non-defined or methods without body and can be used for the future implementation by other class interfaces cannot be used to create objects. Interface methods do not have a body - the body is provided by the "implement" class. On implementation of an interface, you must override all of its methods. Interface methods are by default abstract
and public and cannot be protected or private. Interface attributes are by default public
, static
and final.
An interface cannot contain a constructor (as it cannot be used to create objects)
The following is a vey Simple Example of all of the topics.
Any comment or suggestion or addition are highly appreciable.
July 21 2022
This is my second post since I involved in blog. Pretty busy in day to day schedule and different workout make no time for me to reinstate in blog post for sometime however I am glad I am back with new content and will be continuing the post now onward.
Although I started my blog related to programming stuff in Java so many more content will be definitely based on the Java Coding. I will be sharing and discussing with you people about the upgraded version of the program too. Hopefully you will like this content and please don't forget to throw your valuable comment and new ideas in the comment section that you all awesome people have.
So for today I will be personally throw some example related to array in Java. As we know Array in Java is series of elements with same data type store in contiguous memory to reduce the multiple variable declaration and later can be access adding index to unique identifier.
September 26, 2022
Hello all we just saw some array initialization and declaration so we will further process with array/s with multidimensional in upcoming blog. So today we still work with array and find out more solution on it which will be helpful in coming days to all viewers and learner as well as programmer.
Lets take look array into deep with more example and description. While moving to array part things we have to sure is initialization and using it program this is basic things need to keep as pre-requisite. For more detail, you can check my previous post.
Creating class called ArrayClass.java
Good to see you back today coding is again based on array, hopefully you are learning or understanding something more about data management using array from previously posted code with meaningful statement. Here today I am doing something same using array but with different output which might be useful for some user and for some not but I wish from your side to look on the code and if stuck or have some query related to the question than please feel free me to comment in comment section which are open 24 and 7. Below is the code with requirement.
This is another pretty interesting post regarding to single dimensional array to find out the great, small and equal number from the elements of given array. Since it sound pretty easy for lot of people but still it good concept to understand how the checking happen in Array with three different input for the beginner to mid-level programmer. Hopefully this post will be another good practicing's program for array to many programmer. Please share your thought and query down below comment section.
In this post there is some quick info and code about the creating own getter setter for any variable type using generic class since I tried to Simply explain the detail how code is running and how it is connected to each other. Some documentation in the code itself will make some clarification about how and when is good to use some created method.
Hopefully you will like the post and don't forget to put your valuable suggestion or comment in comment box.
Today I brought some new code related to java.util.ArrayList and see how to use the class as type for the method. Since, this is little complex topic with implementation but for sure you will be understanding very clearly if you see the code how it working and if still you have some doubt or query than please feel free to write comment with date posted and number of line that makes confusing. I used two different class first is MyClass which is also main class and another is Struct class which also act like struct for MyClass or any other class using this class. Hope to see your valuable comment in comment box.
Hello Everyone today post is something more in detail about the array and class using different instant property to explain about the Struct in Java. Since this is custom Struct can be created by programmer rather than any library of inbuilt struct just like C program.
Here we are trying to see how the one class properties can be worked as other class implementation. So further delay lets dive to example and please just let me know anything new or update to that code to make better struct complex type.
Thank you and waiting to hear any kind of suggestion or question.
In today's post there is some useful coding regarding to interface and abstract method in Java and testing very simplified way to understand how it works in real world scenario. Hopefully you are pretty familiar with the interface and abstract terminology but briefly let's talk about. " It is better to use interface when various implementations share only method signature. Polymorphic hierarchy of value types.The interface cannot contain data fields. You cannot use access modifiers for the method, properties, etc. An interface can inherit multiple interfaces but cannot inherit a class. An interface cannot declare constructors or destructors.
It should be used when various implementations of the same kind share a common behavior. The class can have data fields. You can use an abstract class which contains access modifiers".
If you have still some query and question please feel free to comment and leave your suggestion if had some.
Back Again with new topic today I am posting some sorting algorithm code here to know how it work techically and adding new content on it just after sorted value of array how to save in arraylist to increase the size of the array container and trasnversing the arraylist using iterator method and adding to it. While uisng sorting algorithm the time complexity of algorithm is O(n^2) and space is O(1).
The below code in 1 part shows selection sort using primitive data type and in part 2 the selection sort is done using Wrapper class. If you have any question or confusion please fill free to share or comment your valuable content.
After pausing sometime I am back with some content related to Collections framework Map interface with generally HashMap article. We will be looking some methods available in HashMap that will give multiple way to access the data.
Below is the code with output please feel free to give your comment and suggestion.
January 27, 2023
For today topic will be covering some Exception in Java which is abnormal break of program. There is System as well as Custom/User defined Exception and the last is Error. System defined Exception have two different types Checked and Unchecked Exception. In below figure I/O exception to Runtime Exception is Checked because its throw error during compile time and from Arithmetic to Index out of Bound Exception is Unchecked which means its only throw error during runtime.
January 31, 2023
Source c-jump.com |
Source: o7planning.org |
"Java supports a special block, called a static block (also called static clause) that can be used for static initialization of a class. This code inside the static block is executed only once: the first time the class is loaded into memory". Before JDK 1.6 we can run the statement without main method using static block but after 1.6 version its not allowed without main method.
February-12, 2023
Today we are going to review some generic code with wildcard to see the extension of extended or implemented class of Integer or Double from Number.
Today story we will be looking for Complex type and passing as array to the constructor of other class to make new objects using Static array. In below class MyClass which is main class hold the complex type Customer class as generic type for ArrayList class and adding the String and Double value using constructor of Customer Class. We have another class Stores which is calling the Customer Class and passing as generic type of ArrayList here also. So we are using different Util Class and passing another class into it and trying to access all the properties and method of two others class. The code below is all clear to see what is it doing but if you have some query or suggestion please feel free to pass the comment in comment box.
Today topic we will be discussing about comparator and comparable interface to compare objects.
Simple definition and with some example below will hope it will make more sense. Lets see first Java Comparator interface used to order the objects of a user-defined class.
This interface is found in java.util package and contains 2 methods compare(Object obj1,Object obj2) and equals(Object element).
In same way Java Comparable interface is used to order the objects of the user-defined class. This interface is found in java. lang package and contains only one method named compareTo(Object). It provides a single sorting sequence only, i.e., you can sort the elements on the basis of single data member only.
In this post we will overview to Collections Framework in Java. Normally we use dynamic form of array when using the Object class or wrapper class to execute faster as well insert , delete, transverse etc. The example below is small but very useful content regarding List of List using different data value inside it. Please comment if you have question regarding to example I will be more than happy to discuss and find out more deeply different approach for the application.
Today's post is related to reversing the list elements using different methods of Collections framework as well as using stream collectors and generic type to check how the class and there function can be used to get desired output in the Java program. Since we know as Java 8 was launched many new featured and configuration was adapted with this JDK version. So stream is also part of it with powerful functional defining capability which reduced a code and give the same output despite of writing multiples lines of code.
If you have any comment or suggestion please feel free to post below in the comment.
This post is related to the recursive call and as we know it is a method that calls itself to solve a problem by breaking it down into smaller subproblems. Recursive functions can be very useful in programming, but they can also be inefficient if not implemented correctly.
In terms of time complexity, a recursive function can be O(n) or higher, depending on the number of recursive calls it makes. However, if a recursive function has a constant number of recursive calls, it can be said to have a constant time complexity, which is O(1).
First example we will see the recursive call to solve the factorial number and than we will jump to sequential number adding itself with both by formula and recursion and lastly we will see without using looping condition first by stream and another by recursion adding all the elements of an arrays. So Just get relax and try to understand the flow if you are new to programming world.
Thanks for sharing this content though its simple but might be good for beginner learner.
ReplyDelete