MY code is: public class P1{
public static void main(String ar[])
{
class.forName("java.lang.String");
}
}
errors i got are :New.java:5: error: <identifier> expected
class.forName("java.lang.String");
^
New.java:5: error: invalid method declaration; return type
required
class.forName("java.lang.String");
^
New.java:5: error: illegal start of type
class.forName("java.lang.String");
^
New.java:7: error: reached end of file while parsing
}
^
4 errors
HELP ME>......

Answer Posted / salman

public class P1
{
public static void main(String args[])
{
try
{
Class.forName("java.lang.String");
}catch(Exception ex){}
}
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to know howmuch data is truncated?

1985


What is database deadlock ? How can we avoid them?

600


What are the differences between statement and preparedstatement interface?

591


Is jdbc a web technology?

568


What is a jdbc connection?

548






What is execute in java?

595


What does setautocommit do?

635


What are the differences between setmaxrows(int) and setfetchsize(int)?

636


How can I get or redirect the log used by DriverManager and JDBC drivers?

593


What does connection pooling mean ?

650


What is the major difference between java.util.date and java.sql.date data type?

564


If you are given a choice to implement the code to either insert a record or update if already exist, which approach will you follow ?

651


How to connect html page to database using jdbc?

562


What are the types of jdbc drivers that exist?

611


What is the role of jdbc drivermanager class?

655