No cases in switch case : C Programming

No cases in switch case void main() { int choice = 2 ; switch(choice) { } }Explanation : Consider the above switch case example in C Programming. In this example, we have written the switch case with no cases in switch case Re-commanded Article : Rules of using switch case | Invalid ways of switch caseWe never write such kind of statement because it is not required at all while writing code in C but still syntactically no cases in switch case [...]

jQuery Events

Whenever user try to perform certain action on the different elements of the webpage then response of web page to that action is called as Event. Some Examples of Actions are : Consider the following events -Clicking on Button Selecting Value from drop down menu Double Click on Text Submitting form Resizing the Window Scolling page up/downGenerally term "fire" is used when we trigger any event. i.e User fires "click" event on button in order to submit a form. Syntax of Event : Consider that, we want to [...]

jQuery Selectors

In the previous chapter we have learnt how jQuery works. In this tutorial we will be learning jQuery Selectors. jQuery Selectors :CSS selectors are used to style the HTML elements. Similarly we can use jQuery to add behavior to the HTML element. jQuery Selectors are used to find or select HTML element. All selectors in jQuery start with the dollar sign and parentheses: $().Different Ways of Using Selector are explained below - 1. Using Element as Selector We can use HTML element as jQuery [...]

jQuery Syntax

We have already learnt about selector concept in CSS. In CSS selector is used to visually style the HTML elements. In jQuery using selector we can add behavior to ELement. Selector in jQuery : Following is the syntax for jQuery Selector - $(selector).action() We are selecting the HTML element and then we are applying certain action or behavior to that element.Let's see how it can be done using following table -The Document Ready Event : We can apply events and behavior to an [...]

jQuery Installation

Add jQuery to Webpage : It is very simple to include jQuery in your webpage. We can add jQuery to your webpage by simply adding single line of code. First of all we need to download the jQuery from the jQuery Site. There are two versions of jQuery :Adding Downloaded jQuery : After downloading jQuery, We can add it directly in webpage like below -<head> <script src="jquery-1.10.2.min.js"></script> </head>We can reference the jQuery file using the script tag in the head section of webpage. Adding [...]

jQuery Introduction

jQuery is a fast,lightweight JavaScript library created by John Resig in 2006. jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for Rapid Web Development. What is jQuery ?jQuery is a Freely available JavaScript Library. jQuery Simplifies JavaScript programming. jQuery is Open Source and cross browser compatible jQuery is a Light Weight and simple to use which makes jQuery most popular JavaScript Framework.Versions of jQuery :How do i get jQuery ?Visit jQuery Download After Visiting the link click on the Download jQuery [...]

Java packages

Packages are containers for classes. Packages are collection of similar type of classes in Java. In java there are two types of packages - User Defined Package and Built in Packages. A. Need of Packaging :Maintainability : Suppose we are developing the big project then instead of keeping all the classes together under same name we can categorize them in the different folders called package. Avoid Confusion : If Java provides us complete code in single package then it would [...]

Java type casting - Inheritance

Converting one type of value to another is called as Type Casting. Different Forms of Type Casting : There are two types of type casting.Live Example of Type Casting in Inheritance :package com.c4learn.inheritance;class Vehicle { String nameOfVehicle; }class TwoWheeler extends Vehicle { String vehicleModel; }public class TypeCastExample { public static void main(String[] args) { Vehicle v1 = new Vehicle(); Vehicle v2 = new [...]

Java Interview Question #3 : Can Java have blank final Value ?

Que 3. Can Java have blank final Value ? Answer : Nopackage com.c4learn.inheritance;public class BlankFinalValue { final int myValue; public BlankFinalValue(){ this.myValue = 3; } public static void main(String[] args) { BlankFinalValue s1 = new BlankFinalValue(); } }Output : Compiler Successfully Explanation :We cannot have final Value which is [...]