Posts

Initializing a Project in Git

Image
 Initializing a Project for the first time in Git Create a new Java Project in Eclipse and add required Java classes/application code Go to the Location where your project is stored i.e. in the eclipse workspace and open git bash there and type: "git init"  2. Create a new Repository on Github web 3. Now, do: "git remote add origin https://github.com/kadukrunal/<project_repo_name>.git" 4. Now, one can push data to the master branch

Jenkins CICD in One Page

Image
   Jenkins Architecture: Jenkins follows a Master/Slave architecture where master and slave communicate over TCP/IP protocol Jenkins Architecture has 2 main components: 1. Jenkins Master/Server          2. Jenkins Slave/Node/Build Server 1. Jenkins Master: The Main Server of Jenkins i.e. the brains is the Jenkins Master It is a dashboard which is powered from a war file Runs on port 8080 by default With the help of the dashboard we can configure the jobs/projects but the build takes places in the Node/Slave server By default one node is configured and running in Jenkins Server We can add more nodes using IP addresses, username, passwords using jnlp, ssh or webstart methods The main job of server is: Scheduling build jobs Dispatching builds to the nodes/slaves for actual execution Monitoring the nodes/slaves Recording and Presenting the build results A Master/Server instance of Jenkins can execute build jobs as well i.e. it can also act as a node itself 2. Jenkins Slave: The Jenkins sla

Vector vs ArrayList in Java

  Sent by Copilot: ArrayList vs. Vector in Java Both  ArrayList  and  Vector  are part of the Java Collections Framework and implement the  List  interface. They are used to store dynamically resizable arrays of objects. However, there are some key differences between them: 1. Synchronization ArrayList : Not synchronized, meaning it is not thread-safe. Multiple threads can access an  ArrayList  simultaneously without any synchronization. Vector : Synchronized, meaning it is thread-safe.  Only one thread can access a  Vector  at a time, which can be useful in multi-threaded environments but may lead to performance overhead 1 2 . 2. Performance ArrayList : Generally faster because it is not synchronized. Suitable for single-threaded applications. Vector : Slower due to synchronization.  Suitable for multi-threaded applications where thread safety is required 1 2 . 3. Growth Rate ArrayList : Increases its size by 50% of the current array size when the number of elements exceeds its capaci

Vector in java

  Sent by Copilot: Vector in Java Collection The  Vector  class in Java is part of the  java.util  package and implements the  List  interface. It is similar to  ArrayList  but with some differences, primarily related to synchronization. Key Characteristics of Vector Resizable Array : Like  ArrayList ,  Vector  implements a dynamic array that can grow or shrink as needed. Synchronization : All methods in  Vector  are synchronized, making it thread-safe. This means that only one thread can access a  Vector  object at a time, which can be useful in multi-threaded environments but may lead to performance overhead. Legacy Class :  Vector  is considered a legacy class, but it is fully compatible with the collections framework. Creating a Vector You can create a  Vector  in several ways: Java import java.util.Vector; public class VectorExample { public static void main (String[] args) { // Default constructor Vector<Integer> vector1 = new Vector <>(