Posts

Showing posts from May, 2023

CSS Button style animation for biggners

Image
SOURCE CODE HTML  :    CSS  :         @keyframe -   In CSS, a keyframe is a reference point used in CSS animations or transitions to define specific moments or positions of an element during the animation. A keyframe is created using the @keyframes rule, which specifies the properties and values of the element at specific percentage points or keyframes throughout the animation. in the above example the exe  is the name of the animation that must be specified in the required css rule by using  animation-name tag . animation-duration  defines the time of animation and animation-itration-count used to define the number of times the animation should work in the example it is set to infinity so it work infinitley.  FEEL FREE TO ASK ANYTHING IN THE COMMENT I WILL UPDATE IT PROPERLY AS YOU ASK !. Thanku for reading....

Method overloading (java)

Image
  Method Overloading (java) syntax:    Method overloading in Java allows you to define multiple methods with the same name but different parameter lists. When a method is overloaded, the compiler chooses which version of the method to call based on the number and types of arguments passed to it. Here is the syntax for defining overloaded methods in Java: In this example, the MyClass class defines three methods with the same name, myMethod , but different parameter lists. The first method takes one integer parameter, the second takes one String parameter, and the third takes one integer and one String parameter. To call an overloaded method, you simply use the same method name with the appropriate arguments: In this example, the myMethod method is called three times with different arguments, and the appropriate version of the method is executed based on the number and types of arguments passed. NOTES WILL BE UPDATED AS THE NEED! IF EXAMPLES REQUIRED PLEASE COMMENT BELOW!

Constructor Overloading (java)

 CONSTRUCTOR OVERLOADING (java) example of a class that has both a default constructor and a parameterized constructor in Java: Source code:   public class Person { private String name; private int age; // Default constructor public Person () { name = "Unknown" ; age = 0 ; } // Parameterized constructor public Person ( String name, int age) { this .name = name; this .age = age; } // Getter methods public String getName () { return name; } public int getAge () { return age; } // Setter methods public void setName ( String name) { this .name = name; } public void setAge ( int age) { this .age = age; } } In this example, we have a class called Person with two constructors - a default constructor and a parameterized constructor. The default constructor sets the name field t

Array concept in java with example

Image
 ARRAY CONCEPT (JAVA) In Java, an array is a data structure that allows you to store a fixed-size sequence of elements of the same type. An array can be declared by specifying the type of the elements it will contain, followed by the square brackets [] , and then the name of the array. For example, in the program I provided, we declare an integer array called myArray like this: int [] myArray = new int [ 5 ]; This creates a new array of integers with 5 elements. The new keyword is used to allocate memory for the array, and the number inside the square brackets ( 5 in this case) specifies the size of the array. Once we have declared an array, we can access its individual elements using their index, which is a zero-based integer value that indicates the position of the element in the array. For example, to set the first element of myArray to the value 10 , we do: myArray[ 0 ] = 10 ; Here, myA