File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "interface" Watch "interface" New topic
Author

interface

Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
If i am not marking interface as public,then does it implicitely remain public?
I am confused..
I know its basic..
Please answer anybody.
Pramod Deshbhratar
Greenhorn

Joined: May 21, 2008
Posts: 2
Hi TusharTRUE..............

The interfaces themselves need not be public and several interfaces in the standard libraries are not public and thus used only internally.........



Pramod Kumar...........
Pramod Deshbhratar
Greenhorn

Joined: May 21, 2008
Posts: 2
Hi TusharTRUE..............

The interfaces themselves need not be public and several interfaces in the standard libraries are not public and thus used only internally.........



Pramod Kumar...........
Pratap koritala
Ranch Hand

Joined: Sep 27, 2006
Posts: 252
You shouldn't post same too many times..
[ May 22, 2008: Message edited by: Pratap Chowdary ]
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1278

It's exactly like Pramod said. Don't confuse the modifiers of the interface itself with the modifiers of the methods declared in this interface! The methods have public access by default but the interface doesn't if you leave out the public keyword!

As it seems you're trying to learn the Java language at the moment. I'd suggest you take an IDE of your choice like Eclipse or Netbeans and just use it to play around a little. The IDE knows all the syntax details and you can test everything you're curious about This will save you a lot of time and answer most of your questions.

Additionally you can always take a look at the Java language specification for more details but don't worry if you don't understand all the subtle details at once.

Marco
[ May 22, 2008: Message edited by: Marco Ehrentreich ]
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Thanks Marco
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Originally posted by Marco Ehrentreich:

As it seems you're trying to learn the Java language at the moment. I'd suggest you take an IDE of your choice like Eclipse or Netbeans and just use it to play around a little.


A better way to start off is to type the java code in a plain editor like Notepad, WordPad. If required and preferred, you can use a rich editors like EditPlus, Textpad so that you get the syntax highlighted with different colours and automatic highlighting of matching curly braces, paranthesis marker etc.,

But never go for an IDE (Integrated Development Environment) which helps you out with the autocompleting of many syntax as they are existing for Rapid Application Development. Please keep that in mind and don't ever go for any IDE until you are very much compliant with the BASICS and foundation of the language!


The IDE knows all the syntax details and you can test everything you're curious about This will save you a lot of time and answer most of your questions.


This is the major reason for avoiding an IDE in the beginner's stage!


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Raghavan Muthu:


This is the major reason for avoiding an IDE in the beginner's stage!


I agree completely.
An IDE is a good tool if you're trying to write a program without learning the details of the language. If you really want to learn the language, stay away from them.

You're not going to have an IDE throwing you hints when you're taking the test.
[ May 22, 2008: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Mustafa Musaji
Ranch Hand

Joined: May 03, 2008
Posts: 52
I wouldn't say stay away from IDE's altogether.

I learnt alot of my Java using Eclipse and it does take a bit of your own initiative to look up why certain things are not working, and not just click an auto fix button (as opposed to being forced to when you use a bog standard text editor). In terms of learning which methods are available to what classes and reading API as you go along, all these things are positive things when you are learning and things a normal text editor doesn't provide. The only downside is the fact that you are not forced to look up why certain things are problems, but like I said, if you are willing to learn and understand why things are the way they are and not take an IDE's word for it, using one is no bad thing. It's a matter of how you prefer to learn I feel.
[ May 22, 2008: Message edited by: Mustafa Musaji ]

SCJP 5.0 - Passed
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Hi Mustafa,

You are right to certain extent. But all what we talk about is the beginner's stage and especially because of the IDE's syntax autocompletion feature, I bet very few people only remember the syntax (in terms of methods in a class, to depict an example), as all would have been taken over by the IDE.

It is called as context sensitive help, wherein placing a dot after a reference name fetches you the list of all available methods and presssing an enter key would complete the method name with even prefilled arguments to the same. This way, your "real learning ability" is going for a toss!

That's what is the general opinion of all i believe! and most of us agree to it!
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Just to add, not just syntax autocompletion in the list.. there are much more. Like you can extract, encapsulate fields from a class and generate an interface out of it., autogenerated code/methods for a class/servlet etc,. autogenerated javadoc for the class/methods, likewise the list continues!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interface
 
Similar Threads
Interface question
interfaces
About Interfaces and Classes
Anonymous class behavior confusion !
nested interface