Sailendra Jena

Greenhorn
+ Follow
since Aug 30, 2010
Sailendra likes ...
Hibernate Spring Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sailendra Jena

Hi,

Can anyone tell me how to make String class object Thread Safe in java?

Thanks & Regards
Sailendra Narayan Jena
7 years ago
Hi,

Can anyone tell me when hashCode() method call in Java Program? When hascode number generate in Java Program? Whether in class loading time or when we are checking for equality between two class objects?

Thanks & Regards
Sailendra Narayan Jena
10 years ago

Jeff Verdegan wrote:

Sailendra Jena wrote:Hi,

Can anyone help me how to print a String in console without using System.out.println() in java?



Why do you not want to use System.out.println? Is this an interview question or a school test? Are there other constraints?

I would suggest looking at the docs for the System class and the PrintStream class to start with.




Hi Jeff,

This is an interview question thats why i am asking this question. Whatever you mentioned that is also not correct way to print the String without using System.out.println(). Without using print related method but i want to print any statement. I am not telling you that i am not using this System.out.println(); i am using this but i want to know that is there any other code available which can print the statement without using System.out.println() method.

Thanks & Regards
Sailendra Narayan Jena
11 years ago
Hi,

Can anyone help me how to print a String in console without using System.out.println() in java?
11 years ago
Hi,

Can anybody help me on this question.

1. In which scenarios we will use static method in Java Program & in which scenarios we will not use static method in Java Program?

2. How to compile Java Program without using javac command?

Thanks & Regards
Sailendra Jena
11 years ago
Hi Joydeep,

Thanks for reply and also understand that link but its not written clearly that in what senarios we required this private constructor. If we are making any class constructor as private accesss specifier then also we can create any number of object of that class then what is the benifits of that private constructor. If that class is allowing me to create any number of object after making that class constructor as private. But according to the rules of singleton object is telling that we can create only one object of that class but here we can create any number of object of this class. Like this example:
class A
{
int i = 10;

private A()
{
System.out.println("Hello World");
}

public static A getA()
{
return new A();
}
}
class Manager
{
public static void main(String args[])
{
A a1 = A.getA();
System.out.println(a1.i);
A a2 = A.getA();
System.out.println(a2.i);
}
}

In this scenarios we can create any number object of this class but according to rules of the singleton object is telling that we can create only one object of the singleton class. Then tell me what is the benifits of this private constructor.
11 years ago
Why we can't keep constructor as private, if we will keep then what is the benefits of that to make it as private?
12 years ago
Why static initialization block, instance initialization block & constructor of a class can't be override in the subclass?
12 years ago
HI
My question is that suppose i am entering 1000 employee name through this class which is directly store inside the ArrayList list object just like as Collection API's ArrayList. Similar to that but only difference is that when i am entering through this class it will store to that ArrayList object.So my question is that how i will access that all employee name through this ArrayList object reference.
13 years ago
suppose a class name is Employee as below examples

here we passing 1000 of employees name only through the object of this class to an ArrayList list=--------------------.Tell me the answer when i will get the name of all employee from the object of the ArrayList i.e through list object?
13 years ago