473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

public classes

plz clear me y two public classes are not allowed in a single java file
Feb 6 '07 #1
4 1441
horace1
1,510 Expert 1GB
plz clear me y two public classes are not allowed in a single java file
if a .java file contains a public class, e.g.
Expand|Select|Wrap|Line Numbers
  1. public class Test1
  2.  
the name of the file must be the same as the class, i.e. in this case Test1.java

hence you cannot have two public class definitions in the same .java file
Feb 6 '07 #2
dmjpro
2,476 2GB
i alse don't understand that
plz give me the solution.....

thanks in advance
Feb 8 '07 #3
:) lol, DO THE WORK FOR ME JEEZ! lol...you could probably import a java file like the project i'm working on, run a program inside a program but you cant(as far as I know, im not very good at this) put two programs in one with separate class headers.
Feb 8 '07 #4
r035198x
13,262 8TB
i alse don\'t understand that

plz give me the solution.....



thanks in advance
Which part do you not understand?

If you have a public class in a file, the name of that class must match the name of that file. That is what horace said.
Feb 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
7
by: Ash Moollan [InfoMaster] | last post by:
Hi there, I am using NDOC to generate docs for one C# project which I wrote. My assembly has some public classes that are not meant to be used by others and I have not documented them. I would...
2
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking afterwards with ILDASM at what is visible in those assemblies from a...
2
by: Burak | last post by:
Hello, I have a web service that has a two user defined public classes. For sake of brevity, I'll write them as follows Public Class Service1 Public Class Class1 Public x as integer End...
8
by: Jordan | last post by:
AFAIK there are two ways to expose members of a base class to a derived or child class: 1. declare the members public in the base class 2. declare them as 'protected' in the base class Is...
2
by: Edward Diener | last post by:
Specifying 'public class' or 'private class' for C++ class definitions is not part of the C++ standard. In a topic in the VS 2005 docs 'How to: Declare public and private on Native classes', it is...
9
by: Rudy | last post by:
Hello All! I'm a little confused on Public Class or Modules. Say I have a this on form "A" Public Sub Subtract() Dim Invoice As Decimal Dim Wage As Decimal Static PO As Decimal Invoice =...
26
by: Zytan | last post by:
What happens if I do this: static byte MemberFunction() instead of: public static byte MemberFunction() I know I can't access it. But what does it default to? Private? I can't find any code...
3
by: guiroux22 | last post by:
Hi everybody, I have two assemblies. The first is used by the client sites and provides some public classes using internal classes (access must be restrictive). The second is an "administrative"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.