Create JavaScript Object

By Object() constructor: var obj = new Object(); By Object.create() method: Object.create: Will return a new object with properties of prototypeObject. var obj = Object.create(prototypeObject); By brackets: It is the same as Object.create() method with a null parameter. var obj = {}; By function constructor: var MySite = function(website) { this.website = website; } var … Read more

External JavaScript File

The src attribute of the script tag is used to add or include external JavaScript files into any number of HTML files. It increases the code reusability. Syntax: <script type=”text/javascript” src=”external.js”></script> First, create a JavaScript file and then save the file with the .js extension. After that, we can use the src attribute of the … Read more

Is JavaScript a case-sensitive language?

Yes. JavaScript is a case-sensitive language. Related topics: What is JavaScript? What are the advantages of JavaScript? What are the disadvantages of JavaScript? Is JavaScript a case-sensitive language? How to use external JavaScript file? How to create javascript object? How to add method to javascript object? What does the isNaN() function? What is the difference … Read more

What are the disadvantages of JavaScript?

1. Security: As JavaScript executes on the client side it can be used to exploit the application. 2. UI inconsistency: Sometimes JavaScript is interpreted differently by different browsers resulting in the inconsistent UI. See more at Javascript overview. Related topics: What is JavaScript? What are the advantages of JavaScript? What are the disadvantages of JavaScript? Is JavaScript … Read more

JavaScript advantages and disadvantages

JavaScript advantages Fast speed: JavaScript is executed on the client side that’s why it is very fast. Easy to learn: JavaScript is easy to learn. Anyone who has basic knowledge of programming can easily learn JavaScript. Versatility: It refers to lots of skills. It can be used in a wide range of applications. Browser Compatible: JavaScript supports … Read more

java star pattern programs

Pattern Example-1 Pattern ******** ******* ****** ***** **** *** ** * package com.w3schools; public class Test { public static void main(String[] args) { for (int row = 8; row >= 1; –row) { for (int col = 1; col

java number pattern programs

Pattern Example-1 Pattern —-Pattern is—- 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 package com.w3schools; import java.util.Scanner; public class Test{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println(“Number of rows you want in this pattern?”); int rows = scanner.nextInt(); System.out.println(“—-Pattern is—-“); for (int i … Read more

What is HTTPServletRequest class?

When a browser requests for a web page, it sends lot of information to the web server which cannot be read directly because this information travel as a part of header of HTTP request. HTTPServletRequest represents this HTTP Request. Related topics What is a Web application? What is a Web browser? What is different between … Read more

java interview questions and answers

Core java interview questions and answers for beginners and professionals on Basics, OOPs, Methods, Overloading, Overriding, Inheritance, Polymorphism, Interfaces, Packages, Abstract classes, String handling, Exception handling, IO, Collections, Multithreading, Serialization and more. Java interview questions why java is platform independent and jvm is platform dependent? List any five features of java? What all memory areas … Read more