Java Basics

I have formatted the Java basics in the pattern of SCJP 1.6 by Kathy Sierra.
Java program is a collection of objects communicating with each other by invoking each other's methods.
Declarations and Access Control

1. What happens when you try to declare a public class inside another public class in java?
Ans: The compiler throws a compilation error "the public class should be defined in its own file.
Inference: A source file can have only one public class, but it can have more than one non public classes.

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days