Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10740 Articles
AmitDiwan
323 Views
Soft references are often used to implement memory-sensitive caches. Let us see an example of soft references in Java −Example Live Demoimport java.lang.ref.SoftReference; class Demo{ public void display_msg(){ System.out.println("Hello there"); } } public class Demo_example{ public static void main(String[] args){ Demo ... Read More
AmitDiwan
169 Views
Following is an example, wherein we will see unreachable statement using the non-final variable −Exampleclass Demo_example { int a = 2, b = 3; void display_msg(){ while (a < b){ System.out.println("The first variable is greater than the second"); ... Read More
AmitDiwan
231 Views
Unreachable statements are those that don’t get executed when the code is being executed. This could be so because −There is a return statement before the code.There is an infinite loop in the code.The execution of the code is terminated forcibly before it executes.Here, we will see how the unreachable ... Read More
AmitDiwan
915 Views
There are four different kinds of references based on the way in which the data is garbage collected.Strong referencesWeak referencesSoft referencesPhantom referencesStrong referenceIt is the default type of reference object. An object that has active strong reference can’t be garbage collected. It is possible only if the variable that is ... Read More
AmitDiwan
202 Views
To support generic programming, as well as perform a stricter type check, Java implements type erasure.All type parameters in generic types are replaced with the bound (if unbounded) or object type. This way, the bytecode will only contain classes, methods, and interfaces.Type casts to preserve the type.Bridge methods are generated ... Read More
AmitDiwan
322 Views
To shuffle a list in Java, the code is as follows −Example Live Demoimport java.util.*; public class Demo{ public static void main(String[] args){ ArrayList my_list = new ArrayList(); my_list.add("Hello"); my_list.add(", "); my_list.add("this"); my_list.add("is"); ... Read More
AmitDiwan
3K+ Views
The MAX_VALUE is used to find the maximum possible value for an integer in Java. Let us see an example −Example Live Demopublic class Demo{ public static void main(String[] args){ System.out.println("The type is"); System.out.println(Integer.TYPE); System.out.println("The size is"); System.out.println(Integer.SIZE); ... Read More
AmitDiwan
283 Views
For longest Palindromic subsequence, the Java code is as follows −Example Live Demopublic class Demo{ static String longest_seq(String str_1, String str_2){ int str_1_len = str_1.length(); int str_2_len = str_2.length(); char str_1_arr[] = str_1.toCharArray(); char str_2_arr[] = str_2.toCharArray(); ... Read More
AmitDiwan
287 Views
Following is the code for adding properties and methods to an existing object in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 20px; font-weight: ... Read More
AmitDiwan
296 Views
Currying − In currying a function takes another function and some arguments. The function then returns one function with one parameter only. It returns the function with one argument which can be chained together.Partial application − In partial application some of the arguments can be bind to some values to ... Read More