In Java, both protected and default access modifiers are used to control access to class members. However, there are some key differences between the two.
The protected modifier makes a class member accessible within the class itself, within any subclasses of the class, and within any other classes in the same package as the class. This means that subclasses and other classes in the same package can access protected members, but classes outside the package cannot.
On the oth…
Java is a popular object-oriented programming language that offers several features to make it easier for developers to write efficient and effective code. One such feature is the “Optional” class, which was introduced in Java 8 to handle null values. Here , we will explore the Optional class in detail, explaining its purpose and demonstrating its usage with examples.The Problem with Null ValuesIn Java, null is used to represent the absence of a value. However, when a variab…
Read moreA. Footballtime limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresponds to players of another team. If there are at least 7 players of some team…
Read moreIf you want to search a number basically you prefer to do a linear search if you have some sorted numbers and your task is to find the specific number what will you do?#include <stdio.h>
int linearSearch(int *arr, int length_arr, int n) {
for (int i = 0; i < length_arr; i++) {
if (arr[i] == n) {
return 1;
}
}
return 0;
}
int main() {
int num[5] = {1, 2, 3, 4, 5};
int length = sizeof(num) / sizeof(int);
printf("%d\n", linearSearch(num, length, 0));
return 0;
}
The t…
Only 5 minutes enough! to do a crazy app .believe me!Download and rate the app from the Google Play Store.Lanka News-3 Languages - Apps on Google Play Everyone -you can read news in 3 Sri Lankan languages Tamil, Sinhala,as well as English -Nowadays This pandemic…play.google.com https://play.google.com/store/apps/details?id=com.academind.SriLankan_NewsPapers
I recently learned about the webview widget. This widget inspired me to create the app. So, in general, I understand the f…
The Best List Handling Methods in Flutter And DartWe can use a variety of methods in a list, but we’ll look at how we can use a list in a flutter to achieve whatever we want and common ways to use a list effectively.forEach methodWhen calling this function, we should pass an anonymous void function as an argument (so it doesn’t return any value).Let us look at some examples.As you can see, when we call the foreach method, it applies the function inside the parenthesis for ea…
Read moreWho is your closest companion or assistant in Flutter? In my viewpoint, the best combination is ctrl+spacebar in my VScode. While developing the app, it is useful to learn about all of the properties that will be used to assign widgets. Let us lower our voices and take more action. Now let us turn our attention to our concept. Today we will learn about the most wanted topic in flutter, and once we understand these fundamentals, we will be able to perform better in flutter.Li…
Read moreIf you want to visit my place, you are always welcome! But be aware that there are two security officers guarding my place. Before allowing you in, they will ask all sorts of questions to verify your identity.They will ask “Who you are?”, “What you are expecting to do?” to which you will have to answer. Depends on the answers my guards will either allow you to the house or restrict access. Just like the security personnel secures the properties by only allowing a verified se…
Read moreWhat we plan to cover in this blog is listed belowTransformationsRotationsScalingImage PyramidsCroppingConvolutions and BLuringSharpeningThresholding and BinarizationEdge Detection and Image GradientsTransformationsTransformations are distortions enacted upon an image. What we can do with these transformations, we use them to correct distortions or perspective issues from arising from the point of view an image was captured.There are two types of well-known transformation on…
Read moreGlare is a visual sensation caused by excessive and uncontrolled brightness. It can be disabling or simply uncomfortable. It is subjective, and sensitivity to glare can vary widely. Older people are usually more sensitive to glare due to the ageing characteristics of the eye.First, We need to detect the place where the glare exists. We can easily identify them using global binarization since when a glare exists commonly, that pixel value is higher than 180. Using that, we ca…
Read more
Social Plugin