Code Snippets in JAVA Programming and their OUTPUTS-Day 3
CODE SNIPPETS OUTPUT
INTERFACE
Concept: Interfaces
interface General
{
public void get();
public void put();
}
class Test implements General
{
public void get()
{
}
public void put()
{
}
public...
More
Code Snippets in JAVA Programming and their OUTPUTS-Day 3
CODE SNIPPETS OUTPUT
INTERFACE
Concept: Interfaces
interface General
{
public void get();
public void put();
}
class Test implements General
{
public void get()
{
}
public void put()
{
}
public static void main(String[] args)
{
System.
out.
println("Implementing interfaces");
}
}
Implementing interfaces
Question: Can we omit ‘public’ keyword from declaration in the interface? Answer: Yes
interface General
{
void get();
public void put();
}
class Test implements General
Implementing interfaces
Less