• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

interface

 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...........
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't post same too many times..
[ May 22, 2008: Message edited by: Pratap Chowdary ]
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marco
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Mustafa Musaji
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic