Skip to main content

Posts

Showing posts from September 13, 2015

SQL Injection

SQL injection is a technique where malicious users can inject SQL commands into an SQL statement, via web page input. Injected SQL commands can alter SQL statement and compromise the security of a web application. SELECT * FROM Users WHERE UserId = 105 or 1=1 Look at the example above. The SQL above is valid. It will return all rows from the table Users, since  WHERE 1=1  is always true. Does the example above seem dangerous? What if the Users table contains names and passwords? The SQL statement above is much the same as this: SELECT UserId, Name, Password FROM Users WHERE UserId = 105 or 1=1 A smart hacker might get access to user names and passwords in a database by simply inserting " or ""=" into the user name or password text box. The code at the server will create a valid SQL statement like this: SELECT * FROM Users WHERE Name ="" or ""="" AND Pass ="" or ""=...

JAVA INTERVIEW QUESTION

1.What is JVM? The Java interpreter along with the runtime environment required to run the Java application in called as Java virtual machine(JVM) 2. What is the most important feature of Java? Java is a platform independent language. 3. What do you mean by platform independence? Platform independence means that we can write and compile the java code in one platform (eg Windows) and can execute the class in any other supported platform eg (Linux,Solaris,etc). 4. What is the difference between a JDK and a JVM? JDK is Java Development Kit which is for development purpose and it includes execution environment also. But JVM is purely a run time environment and hence you will not be able to compile your source files using a JVM. 5. What is the base class of all classes? java.lang.Object 6. What are the access modifiers in Java? There are 3 access modifiers. Public, protected and private, and the default one if no identifier is specified is called friendly, but programmer ca...

java interview questions freshers

What is Polymorphism? The Polymorphism can be referred as one name many forms. It is the ability of methods to behave differently, depending upon the object who is calling it. The key features of Polymorphism are: Allows using one interface for multiple implementations. Supports Method Overloading: Multiple methods with same name, but different formal argument. Supports Method Overridden: Multiple methods have the same name, same return type, and same formal argument list. Explain garbage collection. The Java uses the garbage collection to free the memory. By cleaning those objects that is no longer reference by any of the program. Step involve in cleaning up the garbage collection: Garbage Object Collection: first step is to collection and group all those object which are no more reference with any of the program. We can use the different methods to collect the garbage object like using runtime.gc() or system.gc(). Run Finalize method: To free up those object which i...