Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

exam question  RSS feed

 
soni madhuri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class Stone{

public void myMethod(){
System.out.println("hgdsf");
}


}
public class BigStone{

public static void main(String args[])
{
BigStone[] b = new BigStone( new Stone(), new Stone(), new Stone());
}
}

Can we declare Stone objects like they are in the code.

please need an answer.

madhuri.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you mean by declaring objects in your code. Certainly, you can create new objects in your code, so you code appears completely valid.

-Cameron McKenzie
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!