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...

Why only one Class is public in one file? Explain in
details. Thanks in Advance.

Answer Posted / ganesh slv

You can create one or more classes in single file. Only one
class may be declared as public. This is your Optional.

If you declared a class as public, your file name should be
the save of your class name.

Public class can be accessible from other applications.
Example, your applet code can be run in a web browser. This
public class may execute other classes in the same file.

If you declared two classes as public, your file name will
be what?

Note the Example :

class First {
// Some codes here
}

public class Second {
// some codes here
// In core, your main method should be here.
// You have to save the file as Second.
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is a variable stored in memory?

1009


How do you escape in java?

1080


How do you declare a variable?

1093


How do you remove an object from an arraylist in java?

971


How do you define a parameter?

1035


Explain the difference between arraylist and linkedlist in java?

985


What are the differences between Java 1.0 and Java 2.0?

2274


what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread

936


What are heap memory and stack memory and what are memory tables.

989


What is the difference between break and continue statements?

1040


Explain java coding standards for constants?

1014


worst case complexities of Quick sort and Merge sort.

1031


What is java abstraction with example?

1066


What is array pointers ?

1031


What does bitwise or mean?

1084