1542 Views
In Java scope of a variable is the section of the program where the variable is attainable inside the area where they are created. Like C/C++, in Java, all identifiers are logical or statical examine, i.e.scope of a variable can be set at compile-time and independent of the function call stack.  Method ...
Anamika Gupta
May 02, 2022
1375 Views
As we know that Java is an object-oriented programming language. It is allied with classes and objects together with its attributes and methods. For example: in real life, a Perfume is an object. The Perfume has attributes, such as smell and color, and methods, such as cold-extraction and Distillation. The ...
Anamika Gupta
Dec 23, 2021
1605 Views
JTree class in java is a swing component and used to arrange the tree-structured data or hierarchical data. It is a complex component and has a root node an also called a parent node in the tree which is the top of all the nodes.A. node can have many children nodes if a node doesn't,t have any children ...
Anamika Gupta
Dec 22, 2021
1473 Views
Lambda expression is an advanced and primary feature of Java that was combined in Java SE 8. It is treated as a function, so the compiler does not create a .class file. It adds a clear and compressed way to perform one process of the interface by using an expression. It is very useful in the library ...
Anamika Gupta
Dec 20, 2021
1583 Views
Sorting is a way to arrange elements (objects) of a list or array in a certain order. The order may be in ascending or descending order. Another useful class in java.util package.   the java.util package is the Collections class, which include the sort() method for sorting lists alphabetically ...
Anamika Gupta
Dec 15, 2021
1494 Views
The size() method to define that how many times the loop should run. The looping through the principle of an ArrayList with a for loop public class Main {    public static void main(String[] args) {      ArrayList<String> mobiles = new ArrayList<String>();     mobiles.add("Samsung");   ...
Anamika Gupta
Dec 15, 2021
1529 Views
To delete an element, use the remove() method and refer to the index number: import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<String> mobiles = new ArrayList<String>(); mobiles.add("Samsung"); mobiles.add("Apple"); ...
Anamika Gupta
Dec 14, 2021
1492 Views
By using the get() method we can access an element in the ArrayList, which is assigned to the index number: import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<String> mobiles = new ArrayList<String>(); mobiles.add("Samsung"); ...
Anamika Gupta
Dec 14, 2021
1471 Views
In java.util package the ArrayList class is found which is used to resize Array. The main difference between an ArrayList and a built-in array in Java is that the syntax is also slightly different and the size of the array cannot be modified. Whenever you want to you can add and remove elements from ...
Anamika Gupta
Dec 14, 2021
17070 Views
Date and Time modification is a very common part of development. In Javascript add or subtract different date parameters is as easy as other languages. We have explained different addition and Subtraction with the example below: Add or Subtract Days: const date = new Date(); const additionOfDays ...
Sheetal Kumar
Feb 28, 2020
4932 Views
Sometime you need to trim or remove a charecter from left or right. For example: http://devstudioonline.com You need to remove http:// from left. Then you need a function to trim from left side with given charecters or string. public static String ltrim(String str, String trimchar){ ...
Sheetal Kumar
Oct 16, 2019
7155 Views
In most of the places in UI you need to display date and time in your format weather API is providing date and time in MySql Format that is YYYY-MM-DD H:M. To convert this I have created a function that can be used easily in javascript without and dependency. function formatDateMysql(mysqldate) ...
Sheetal Kumar
Jan 15, 2019
12486 Views
In Javascript sometimes you need a Random Integer. Here is the best way to get Random Integer number in Javascript.   function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } Test the function: console.log("Random ...
Sheetal Kumar
Jan 07, 2019
5007 Views
When you work in JavaScript then this keyword changes the context or scope based on how it is used. So here are some examples of how to use this keyword in JavaScript. function func_1() { console.log(this); } // calling a function func_1(); // this pointing to window // as object method var ...
Sheetal Kumar
Dec 04, 2018
2273 Views
The String class maintain many efficiency for processing String. However , once a String object is build,its contents will remain same.String object are constant string and StringBuffer object are modified strings. Java can perform certain development involving String because it knows that these object ...
Anamika Gupta
Oct 03, 2018
Page 1 of 3 Pages       Total Records 33