TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
SUNIL GUTTA
NA
1k
394.3k
basic java doubt ? access specifier ?
Oct 26 2013 7:04 PM
Hi
HERE is mu program .. it works fine no problem with that .. but it only compiles when i remove public specifier from the class " Horsetest" .. why is this happening ?? any ideas .. in c# if we declare like this program will execute no compile error .. why
Program :
public class HorseTest
{
public static void main (String [] args)
{
class Horse
{
public String name;
public Horse(String s)
{
name = s;
}
}
Object obj = new Horse("Zippo");
Horse h = (Horse) obj;
System.out.println(h.name);
}
}
please help me :) cheers
Reply
Answers (
11
)
recursion help ??
reversing the strings in different ways ?