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
What are the different types of drivers under jdbc?
What class.forname will do while loading drivers of jdbc?
What are the steps to connect to the database in java?
What is ojvm used for?
Does jdbctemplate close connection?
Is possible to open a connection to a database with exclusive mode with JDBC?
Does jdbctemplate use prepared statements?
What is drivermanager in jdbc?
What is createstatement method in java?
What is a java driver?
Name the method, which is used to prepare a callablestatement.
What is use of connection pooling?
How many categories of jdbc drivers are there?
How many types of JDBC Drivers are present and what are they?
How do you insert images into database using jdbc?