Pass user input from command line in java

Pass user input  from command line in java
There is a various way, you can pass parameter from a console . Using BufferdReader,InputStream but the easiest way to do it with Scanner class it took Inputstream(System.in) as parameter from we can get user given value Let see an example package...

Spring framework download and integration with eclipse step by step.

Spring framework download and integration with eclipse step by step.
In this tutorial we will learn how we can download spring framework jars for eclipse and integrate the downloaded spring framework with eclipse . Then we create a basic Spring example to check our setup is successful or not. Here...

multiple inheritance in java?

 multiple inheritance in java?
Java directly does  not support multiple inheritance , but by interface it supports the same. To understand why java does not support multiple inheritance  first we need to understand the Diamond problem Diamond problem says Suppose we...

Does Java support multiple inheritance?

Does  Java  support multiple inheritance?
Java directly does  not support multiple inheritance , but by interface it supports the same. To understand why java does not support multiple inheritance  first we need to understand the Diamond problem Diamond problem says Suppose we...

Does runtime polymorphism can be acheived by data memebrs?

Does runtime polymorphism can be acheived by data memebrs?
No Overriding can not be performed on properties/data members it always call the reference class properties value Let take an example Public class Father {   public  int age=60; } Public class Child extends Father {   public ...

How does Map work in Java?

How does Map work in Java?
HashMap in Java works on hashing principle. The Map is a data structure which allows us to store object with a key and retrieve same by the same key. Hash functions are used to link key and value in HashMap. Objects are stored by calling put(key, value)...

what is servlet collaboration?

what is servlet collaboration?
Servlet Collaboration means how one servlet can communicate with other. Sometimes servlets are to pass the common information that is to be shared directly by one servlet to another through various invocations of the methods. To perform these operations,...

Can we Overload Main method in java.

Can we Overload Main method in java.
Yes you can overload main method but public static void main(String[] args) is entry point in java. JVM always search for this method. If it is not present in overloaded version ,when you try to run your code that gives run time exception no main method...

Display trangle in screen using Java.

Display trangle in screen using  Java.
package com.example.loop.star; /*  *  * This class display triangle as follows  *  *         *  *        * *  *     ...

Is Spring Bean Thread Safe?

Is Spring Bean Thread Safe?
Thread safety is a different context . Singleton spring beans has no relation with thread safety. spring container only manages life-cycle of objects and guaranteed that only one object in spring container. so If an Non thread safe object is injected...

How do you handle error condition while writing stored procedure or accessing stored procedure from java?

How do you handle error condition while writing stored procedure or accessing stored procedure from java?
When you call a store procedure the store procedure will execute in database server so if there any exception occurs that can be handled in EXCEPTION block in the store proc. If the store procedure it self fails it throws sql exception which can be...

What is JCS?

What is JCS?
JCS stands for Java Caching System. This is an open source project and released by Apache written in Java.  Like all other caching system JCS  has following features. 1. JCS supports In memory cache. 2. Provide method for add objects in Cache. 3....

How to get client machine name and Ip address from Httpservlet?

How to get client machine name and Ip address from Httpservlet?
In HttpServletRequest there are two methods  a. getRemoteAddr()  b. getRemoteHost()  which will provide the necessary information.  Actually in request header following information is stored. Ip address of client m/c = request.getRemoteAddr(); Hostname...

What is difference between include action and include directive in JSP?

What is difference between include action and include directive in JSP?
Before starting the difference  discussion,  first, we have to understand the JSP life cycle. when a request first comes to a JSP it will translate into servlet then compile and load into web container for further use. Subsequent requests ...

Benifits of Static methods

Benifits of Static methods
Static keywords mean,  methods/variables attached to class, not with objects. So this variables/methods is shared with all objects instances of this class.Following advantages, we can get using static. 1. We can invoke a static method without...

Can we have main method tn abstract class?

Can we have main method tn abstract class?
Yes, you can use the main method in abstract class. The main method is a static method so it is associated with Class, not with object/ instance. The abstract is applicable to the object so there is no problem if it contains the main method. In main...

Can we Instantiate Abstract Class?

Can we Instantiate Abstract Class?
The main reason is   abstract class may have abstract methods . An abstract method is like template/contract, according to inheritance rule  every concrete subclass must have to provide a concrete definition of the same. So we can say...

Can we make constuctor as final

Can we make  constuctor as final
No Constructor can never be Final. Only private,public and protected modifiers can use with the constructor. We use final in method level because  we don't want subclass inherits that method and overwrite it . But constructor is not a method...