In this tutorial you will learn more Java and will look at Java’s inner classes. This will allow you to write a simple Java app that you can then use in your IDE
About this Tutorial –
Objectives –
This course is aimed at object-oriented developers (e.g. C++ or C#) who need to transition into Java. It is also aimed at those learning to program for the first time; the course covers the Java programming constructs and APIs quickly, focussing on the differences between Java and other OO languages.
Audience
This training course is aimed at OO developers who need to transition into Java.
Prerequisites
No previous experience in Java programming is required. But any experience you do have in programming will help. Also no experience in eclipse is required. But again any experience you do have with programming development environments will be a valuable.
Experience using a contemporary OO language such as C++ or C# would be useful but is not required.
Contents
The Java course cover these topics and more:
- Flow Control: Decision making: if and if-else; The switch statement; Looping: for loops; while loops; do-while loops; for-each style loops; Assertionsv
- Concurrency: Overview of multithreading; Creating new threads; Object locking; Using wait, notify, and notifyAll
- Collections: Overview of Java SE collection classes; Generics; Using List-based collection classes; Using Set-based collection classes; Using Map-based collection classes; Collection techniques
Exam Preparation
The Java course will help you prepare for these certifications:
- Oracle Certified Java Associate – Exam 1Z0-803
- Oracle Certified Java Professional – Exam 1Z0-804
Quick Access
Overview
Estimated Time – 1.5 Hours
Not what you are looking? Try the next tutorial – File Handling
- What is an Inner Class?
- So far in this course, all of the classes have been defined as “top-level” classes
- One public class per Java file
- Plus other non-public classes, if you like
- Java also allows you to define inner classes
- Define class(es) inside the scope of another class
- So far in this course, all of the classes have been defined as “top-level” classes
- Why Define Inner Classes?
- Firstly, note that most classes ARE NOT inner classes
- They are top-level classes, as we’ve been using so far on this course
- One of the benefits of inner classes is that they offer a nested scope:
- Another potential benefit is consistency:
- Several outer classes can have similar inner classes
- You can give each inner class the same name
- Firstly, note that most classes ARE NOT inner classes
- Types of Inner Classes
- There are several types of inner classes:
- Regular inner classes
- Method-local inner classes
- Anonymous inner classes
- Static nested class
- We’ll take a look at each approach in the next few sections in this chapter
- There are several types of inner classes:
Lab 1: Regular inner classes
Lab 2: Method-local inner classes
Lab 3: Anonymous inner classes
Lab 4: Static nested class
Well done. You have completed the tutorial in the Java course. The next tutorial is
13. File Handling
Copyright © 2016 TalkIT®
If you would like to see more content like this in the future, please fill-in our quick survey.