Hi to all,
It’s one of the question in test, I am confused please someone help.
MainClass{
Public static void main(String [] a){
Employee e=new Employee();
for(int i:e){
// Something
}
Now If I compile this code I will get an error. But without changing for each condition I want to construct an Employee class and solve the error.
In foreach only I can iterate over an array or Iterable. Then how it’s possible.
Thanks,
sasikrishnasamy 0 Newbie Poster
Hiroshe 499 Posting Whiz in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
jwenting 1,889 duckman Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.