Skip to content

ketsia0623/learning-JAVA

Repository files navigation

Getting Started

Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.

Folder Structure

The workspace contains two folders by default, where:

  • src: the folder to maintain sources
  • lib: the folder to maintain dependencies

Meanwhile, the compiled output files will be generated in the bin folder by default.

If you want to customize the folder structure, open .vscode/settings.json and update the related settings there.

Dependency Management

The JAVA PROJECTS view allows you to manage your dependencies. More details can be found here.

DEFINITIONS LEARNED

  • Java Virtual Machine(JVM) is responsible for the hardware- and operating system-independence of the Java SE platform, the small size of compiled code (bytecodes), and platform security

Other Important Things Learned

  • I CAN LABEL MY LOOPS
  • Java passes everything by value
    • For primitives, the value is just a number
    • For objects, the value is the memory address (reference)
  • If I want my decimal value to have the float datatype, I HAVE TO HAVE THE F or f
  • Java is platform Independent, so code compiled on Windows can run on Linux, as long as it the Java Runtime Environment
  • Ifs, for and while loops have their own scope unlike python
  • Variable declarations are bound to their scope, and you cannot redeclare a variable in the same scope
  • If finally block has a return statement, it overrides any return from try or catch blocks
  • Local variables(like in methods) can't be private
  • Private variables and methods aren't inherited so they can't be overriden
  • STRINGS ARE IMMUTABLE
  • StringBuilder is mutable
  • Switch doesn't take in booleans!!
  • Can't use both super(...) and this(...) in a constructor, only one and must be the first statement
  • commas aren't used to seperate cli arguments
  • Inside a static method, you cannot directly access non-static (instance) variables
  • For lambda, when { } are used, a return is needed

Section 1: JAVA Basics

Go to Section 1

Section 2: Working with Java DataTypes

Go to Section 2

Section 3: Using Operators and Decision Constructs

Go to Section 3

Section 4: Creating and Using Arrays

Go to Section 4

Section 5: Using Loop Constructs

Go to Section 5

Section 6: Working with Methods and Encapsulation

Go to Section 6

Section 7: Working with Inheritance

Go to Section 7

Section 8 Handling Exceptions

Go to Section 8

Section 9 Working with Selected Classes from the Java API

Go to Section 9

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages