Java-code to find the angle between two hands in an analog clock

In order to get the angle between the minute and hour hand of an analog clock, we should be able to derive the below mentioned angle

  1. Minute hand angle.
  2. Hour hand angle.
  3. Difference between the minute and hour hand angle.

To arrive at these, we should first understand the fundamentals. Let us convert the units to similar stage so that we will be able to get the logic perfectly.

Read more ...

Java Access Modifiers

An access modifier defines the scope of a class or its members. It determines the level of accessibility of the class or its member. By using access modifier you can either allow or restrict accessibility of class, members, variables etc.

Access modifiers allowed in java

  1. Public
  2. Private
  3. Protected

Read more ...

Java Comment

Java Supports 3 types of comments in coding

  1. Single-line comment.
  2. Multi-line comment.
  3. Documentation comment.

PFB the detailed description of the types with example.

Single-line comment

//Line1  - Single line comment 
Eclipse IDE key-board shortcut : Keep the cursor in the exact line and press ctrl+/

Read more ...