In last couple of tutorials you have learned how to get all selected checkbox and radio buttons, and in this tutorial, you will learn how to enable/disable form elements using jQuery. A form element e.g. a textfield, radio buttons and checkbox, all represented using input tag can be enabled or disabled by adding an attribute called "disabled". It's similar to "checked" attribute we have seen for checkbox and radio buttons. If this attribute is not present then element is enable, but if this attribute is present then you can use disabled=true to disable the form element and disabled=false to enable the form elements as shown in our example. Like previous example of checking/unchecking checkbox, you can use prop() jQuery function to enable/disable form element if you are running on jQuery 1.6 or higher version and attr() function if you are running on jQuery 1.5 or lower version.
Sunday, March 31, 2024
How to shuffle a List in Java? Collections.shuffle() Example
Saturday, March 30, 2024
How to Compare Two Dates in Java? Check If They Are Equal, Later or Earlier - Examples
Friday, March 29, 2024
What is transient variable in Java? Serialization Example
Wednesday, March 27, 2024
Difference between HashSet and HashMap in Java? Answered
Hello friends, if you have given Java developer interview then there is good chance that you may have come across questions like Difference between HashSet vs HashMap or HashSet vs TreeSet etc. In this article, we are going to discuss differnece between HashMap and HashSet, two of the popular Collection classes from JDK. The HashSet vs HashMap is a classical Java Collection interview question that focuses on What are differences between HashSet and HashMap in terms of features, usage, and performance. If you are in Java programming even for a year or so, you are likely to be familiar with What is HashSet in Java and What is HashMap in Java, these two are the most popular collection classes.
Tuesday, March 26, 2024
What is PATH and CLASSPATH in Java? Path vs ClassPath Example
The PATH and CLASSPATH are the two most important environment variables of the Java environment which are used to find the JDK binaries used to compile and run Java in windows and Linux and class files which are compiled Java bytecodes. From my personal experience I can say that PATH and CLASSPATH are the two most problematic things for beginners in Java programming language due to two reasons; first because in most Java courses nobody tells details of what is a PATH and CLASSPATH, What do PATH and CLASSPATH do, What is meaning of setting PATH and CLASSPATH, What happens if we do not set them, Difference between PATH vs CLASSPATH in Java or simply How Classpath works in Java, etc.
Monday, March 25, 2024
Why is main method public, static, and void in Java? Answer
The main() method in Java is a special method that is used by JVM to start the execution of any Java program. The main method is also referred to as the entry point of Java application which is true in the case of core Java applications because execution starts from the main() method, but in the case of container-managed environments like Servlet, EJB, or MIDlet this is not true as these Java programs have their own life-cycle methods like init(), service() or destroy() for Servlet's which is used by the container. The main method in Java is run by the main thread which is a non-daemon thread and the Java program runs until the main method finishes or any other user thread is running.
Sunday, March 24, 2024
How to convert JSON String to Java Object using Gson? JSON Deserialization Example
Difference between var, val, and def in Scala? Examples
3 ways to convert String to JSON object in Java? Examples
Saturday, March 23, 2024
Difference between Correlated and Non-Correlated Subquery in SQL? Examples
How to sort ArrayList in Java? Examples
Thursday, March 21, 2024
What is final modifier in Java? fina class, method, and variable example
Wednesday, March 20, 2024
Best way to Convert Integer to String in Java with Example
How to create a ZIP File in Java? ZipEntry and ZipOutputStream Compression Example
How to add JAR files in Eclipse Project's Build path? Example
Tuesday, March 19, 2024
5 Tips to Fix Exception in thread "main" java.lang.NoClassDefFoundError in Java, Examples
The Exception in thread "main" java.lang.NoClassDefFoundError is a common error in Java that occurs if a ClassLoader cannot find a particular class in the classpath while trying to load it. The Exception in thread "main" suggests that this error has occurred in the main thread, the thread which is responsible for running the Java application. This error can occur to any thread, but if it happens in the main thread, then your program will crash because Java program runs only until main() thread is running or any other non-daemon thread is running. As per Javadoc, NoClassDefFoundError can be thrown during the linking or loading of the class file.
14 Enum Interview Questions and Answers for 1 to 2 Years Experienced Java Programmers
How to convert String to char in Java? Example Tutorial
How to get current TimeStamp value in Java? Example
5 Difference between String, StringBuffer, and StringBuilder in Java
Monday, March 18, 2024
Difference between include() and forward() methods of RequestDispatcher in Servlert
Base64 Encoding and Decoding Examples in Java 8 and Before
How Java achieves platform independence? Answer
10 Difference between Struts 1.x and Struts 2.x framework in Java
Saturday, March 16, 2024
When You should Not use Microservice Architecture? (Answer)
Hello guys, recently while giving interview in one of the big US based Investment bank I was asked about, what are the scenarios when you shouldn't be using Microservices architecture? When I hear this question I was big surprised not because I didn't know the answer but because most of the people ask about using Microservice architecture and this was the first time I am hearing otherwise. To be honest, it's a good question because most of the candidate will prepare about benefirst about Microservice architecture and they may not know when it's not appropriate to use it. Since I have worked in low latency high frequency application, I knew that multiple process means more latency so clearly a Microservices is a big no if you are working on a high frequency low latency application. In those cases you want to do all your calculations inside a single thread or process without even swapping memory to avoid delay. Hence the first answer to this question was, you shouldn't be using Microservice in a low latency application.