Sorry, your browser is not supported
To have the best experience using Skillshare, we recommend that you use one of these supported browsers.

Core Java Development Course for Beginners - Part 5 - Packages, Classpath, User-input & Debugging

Udayan Khattry, SCJP, SCWCD & Oracle Database SQL Certif

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
11 Videos (2h 45m)
    • Java Package and Classpath 1

      17:55
    • Java Package and Classpath 2

      19:18
    • Java Package and Classpath 3

      19:58
    • Java Package and Classpath 4

      12:25
    • Java Package and Classpath 5

      17:13
    • User input with Scanner 1

      9:50
    • User input with Scanner 2

      11:17
    • User input with Scanner 3

      10:44
    • Miscellaneous 1

      10:46
    • Debugging Java Codes In Eclipse 1

      18:35
    • Debugging Java Codes In Eclipse 2

      16:52

About This Class

895ba7bb

This course is for anyone who wants to learn Java from scratch, polish java skills, face java interviews and prepare for java certifications.


Anyone can take this course and go from 0 developments skills to being expert in OOPs and core Java.
Java is the most popular language world wide and technologies like Servlets & JSP, J2EE, Struts, Spring, Hibernate, JMS or android for mobile applications are all based on core Java. 
Even Kotlin (android's new programming language) becomes easier if you know Java.

Having a sound understanding of core java concepts is necessary, if you want to learn advance concepts, frameworks and android programming. 

Following Lectures are covered in Part-5

 1.            Java Package and Classpath          

In this lecture you will learn:

  • How to use the functionality of third-party classes in our program?
  • Issues with classes belonging to default packages.
    package syntax and its meaning.
  • What are the requirements to run java classes declared with package syntax?
  • javac -help to get help with javac command.
    -d option of javac command.
  • Naming convention for package.
  • Usage of reversed Internet domain to get unique Java class names.
  • How Java Runtime finds the class files to execute?
  • -cp and -classpath options of java command [To specify classes required for execution]
  • Default value of -cp and -classpath option
  • How to execute java classes from other directories / drives available on your laptop/computer?
  • 3 ways to use packaged class from another class:
    • Using fully qualified class name in code.
    • By using fully qualified class name in import declaration.
    • By using wild card (*) in import declaration.

  • Correct order of package, import and class declaration if all three are available.
  • Where to put source code (.java) files?
  • Java project structure followed across industry.
  • Example to use class file from another project.
  • -cp and -classpath options of javac command [To specify classes required for compilation]
  • Use of relative path and absolute path with -cp and -classpath option.
  • Bonus: Trick to open command prompt at any folder location in Windows.
  • How to specify multiple paths in classpath option?
  • Revision of all the cases covered in previous two lectures.
  • Hands-on exercise on using packages.
  • Bonus: tree command to see complete directory structure in tree-view.
  • How Eclipse IDE arranges Java and class files declared in default package?
  • .classpath file in every java project created by Eclipse IDE.
  • How to build projects automatically in Eclipse?
  • How to create packaged classes in Eclipse?
  • How Eclipse IDE arranges Java and class files declared in packages?
  • Restriction on the location of java files created in Eclipse.
  • How to create packages in Eclipse?
  • How to move java files from default package to a particular package?
  • How to refer classes from other projects in Eclipse IDE and how does it affect .classpath file?
  • Difference between Fully Qualified Name and Simple Name of the class.
  • How import statement maps Simple Name of the class to its Fully Qualified Name at compile time?
  • Restriction on the usage of multiple import statements, to point to same Simple Name of the classes in different packages.
  • Order of class name resolution by the compiler:
    • Inline usage of the fully qualified name of the class
    • Fully qualified name of the class used in import statement
    • Wildcard (*) used in import statement
  • Why Classes created in default package can't be used by packaged classes?
  • How to delete a java project and associated project files in Eclipse?
  • Implicit import of all the classes of java.lang package.
  • How to export Java Projects from Eclipse Workspace?
  • How to import Java Projects into Eclipse Workspace?
  • How to do a clean build in Eclipse?

2.            User-input with Scanner                            

                In this lecture you will learn:

  • How to rename java projects in Eclipse IDE?
  • How to accept byte, short, int, long, float, double and boolean values using java.util.Scanner class?
  • util.InputMismatchException is thrown on providing out of range or incompatible values.
  • How to close Scanner object?
  • It is not possible to accept input on closed Scanner object, java.lang.IllegalStateException is thrown in such cases.
  • How to accept String data using nextLine() method?
  • What is the issue of using nextLine() method after other next methods and how to resolve it?
  • How Strings are internally stored as char array in the memory?
  • Use of length() and charAt(int index) methods of java.lang.String class to access all the characters of particular String object.
  • Use of above two methods of String class to accept char value as user input.
  • Ctrl + Shift + O shortcut to import all the classes in Eclipse.

3.            Miscellaneous – 1

In this lecture you will learn:

  • To generate random numbers in Java using java.security.SecureRandom class.
  • About some important methods of String class: length, charAt, equals, equalsIgnoreCase, toUpperCase, toLowerCase and trim.
  • About code which can throw StringIndexOutOfBoundsException.
  • What are whitespaces in Java?
  • Use of Ctrl + Shift + R to Search and Open Project resources / files.
  • About "Link with Editor" shortcut in Eclipse to link Package Explorer with Code Editor window.

4.            Debugging Java codes in Eclipse  

In this lecture you will learn:

  • What is debugging?
  • How to show line numbers in the code editor?
  • What is a breakpoint and how to place it?
  • How to run java programs in debug mode?
  • How to switch between debug perspective and Java perspective?
  • Variables tab and how it helps to check current values of the variables and also to change the variable values.
  • How to Resume or Terminate the program during debugging?
  • Breakpoints tab and how it helps to remove selected breakpoints or remove all the breakpoints.
  • How to disable a breakpoint and how to skip all the breakpoints?
  • Step Over and Run to line functionality.
  • How to execute a statement and see it's result during debugging?
  • How to inspect a variable or an expression?
  • Expressions tab and how it helps to watch an expression?
  • Common mistake made by developers in using expressions tab, to watch any expression that modifies variable's value.
  • How to go to the declaration of any method and come back to the calling code?
  • How to go to the source code of Java class referred in your program?
  • Step Into and Step Return functionality.
  • What is method chaining and how to do it in Java?
  • How to attach Java API source code in eclipse?
  • How to find and open any source code files of Java API in Eclipse?
  • How to jump to any method in the chain using Step Into Selection?

 

--

Students

--

Projects

0

Reviews (0)

Udayan Khattry

SCJP, SCWCD & Oracle Database SQL Certif

Hi, I'm Udayan. I have a master's degree in Computer Applications from Symbiosis International University, Pune, India and have completed following professional certifications:
- SCJP 1.6 (Sun Certified Programmer for J2SE 6.0)
- SCWCD 1.5 (Sun Certified Web Component Developer)
- Oracle Database SQL Certified Expert

After working as a software developer and consultant for over 9 years for various companies in India, Dubai & Singapore, I decided to follow my lifelong passion ...

See full profile