public class AboutStrings{
public static void main(String args[]){
String s1="hello";
String s2="hel";
String s3="lo";
String s4=s2+s3;
//to know the hash codes of s1,s4.
System.out.println(s1.hashCode());
System.out.println(s4.hashCode());
// these two s1 and s4 are having same hashcodes.
if(s1==s4){
System.out.println("s1 and s4 are same.");
}else
System.out.println("s1 and s4 are not same.");
}
}
Somebody told me that, == operator compares references of
the objects.
In the above example even though s1 and s4 are refering to
same object(having same hash codes),
it is printing s1 and s4 are not same.
Can anybody explain in detail why it is behaving like this?
Thanks in Advance
RavuriVinod
dear friends
I have made connection with SQLSERVER where the following
code is compiling properly but giving error at the runtime .
I think error in this line where i am sending the value
through string
Connection connection = DriverManager.getConnection
( "jdbc:microsoft:sqlserver://localhost:1433","sa","");
import java.sql.*;
//import mssqlserver.*;
public class TestSQLCON
{
public TestSQLCON() throws Exception
{
// Get connection
DriverManager.registerDriver(new
com.microsoft.jdbc.sqlserver.SQLServerDriver());
System.out.println();
System.out.println("Successfully connected one");
System.out.println();
Connection connection = DriverManager.getConnection
( "jdbc:microsoft:sqlserver://localhost:1433","sa","");
if (connection != null)
{
System.out.println();
System.out.println("Successfully connected");
System.out.println();
// Meta data
DatabaseMetaData meta = connection.getMetaData();
System.out.println("\nDriver Information");
System.out.println("Driver Name: " +
meta.getDriverName());
System.out.println("Driver Version: " +
meta.getDriverVersion());
System.out.println("\nDatabase Information ");
System.out.println("Database Name: " +
meta.getDatabaseProductName());
System.out.println("Database Version: "+
meta.getDatabaseProductVersion());
}
}
public static void main (String args[]) throws Exception
{
TestSQLCON test = new TestSQLCON();
}
}
so please help me
Q1.A. Write note on “The class path Environment Variable”?
B. Which are different kinds of source code?
Q2.A. How to create an interface?
B. Why convert an applet to an application?
Q3.A. How to use Media tracker Class.
B. How to use string tokenizer class.
Q4 A. Explain the overview of UDP messaging.
B. Difference between SQL Exception class and SQL
Warning class.
Q5. A. How to create com object in Java?
B. Write short notes on “The properties class”
Q6. A. When object is created and destroyed?
B. Explain the JDB in depth & command line.
C. Write short notes on Web Sites.
AS a developer will u create a data source in connection
pool? If so how will u do that, how to access the object
from connection pool using IRAD tool?
128
Explain phantom read?
114
What is scalable, portability in the view of J2EE?
137
Name the components that are termed to be Heavy-weight
component but available in Light-weight components?
370
can anyone explain me the workflow of EJB.I have developed
an app. in WSAD using an example that contains CMP and
session bean.But i am not able to understand the basic flow
between diffrent packages.
how to write uploadphoto in the insert update delete using
struts? write code struts and jsp jdbc
281
what are the new features of Webservices 1.6 than 1.4.From
the interface and implementation aspect4.
3
Hi frnd can i any one kindly can post for me portlet,hibernate
and spring example application and with flow explantion
configuration using Jdeveloper.and related links ar tutorials
kindly please send me .its urgent for me .thanks in
advance...........else can any one send to kondaiah.goddeti@gmail.com
5
Hi friends am newbie to servlet. How code reusability easy
in servlet. why not in jsp . here reusabillity means
only javabeans or any thing else.
14
Am chittibabu from vadavalli,
My father name is nanjan.he is working in state bank of
india at vadavalli,
My mother name is ramal. She is house wife.
My brother name is rajaram he is working in Privete Company.
I was born on 25-january-1984 at bhavanisager in Erode District.
I have completed my school in government higher secondary
school bhavanisager.
After that I came to coimbatore for higher study.i have
joined Bsc computer science in sri ramalinga sowdambigai
college of science and commerce, affiliated by bharathiyar
university, coimbatore.
In the same college, I have continued UG degree also. but I
got a job in Systech infovation as a software programmer,so
I discontinued Msc Degree.I have one and half years
experience from this concern. Here I have completed two
products; one is Tranport management solution for balaji
goods carriers at tirupur. Another one is Embroidery
Management Solution for Angel Embroidery at tirupur.
After that I got an another job in metis technologies as
senior software engineer. I have one year experience from
this company.here I working in school management product.it
is developing version by version.
16
How to pass parameters in RMI?
69
What is difference RMI registry and OSAgent?
244
Difference between DurableSubscription and non-
DurableSubscription?