Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are the different types of drivers under jdbc?

893


What class.forname will do while loading drivers of jdbc?

989


What are the steps to connect to the database in java?

1030


What is ojvm used for?

1037


Does jdbctemplate close connection?

965


Is possible to open a connection to a database with exclusive mode with JDBC?

1008


Does jdbctemplate use prepared statements?

953


What is drivermanager in jdbc?

1017


What is createstatement method in java?

1019


What is a java driver?

1069


Name the method, which is used to prepare a callablestatement.

955


What is use of connection pooling?

1013


How many categories of jdbc drivers are there?

962


How many types of JDBC Drivers are present and what are they?

1271


How do you insert images into database using jdbc?

1133