Basics Flashcards
(35 cards)
Important scanner
Import java.util.Scanner;
Scanner inputData = new Scanner(System.in)
Syntax—>Math random
-50 to 50
0-10
(int) (Math.random() * 101-50)
(int) (Math.random() * 11
String to primitive
integer
String num1 = “22”;
int int1 = Integer.parseInt(num1);
String to primitive
Wrapper class
String n1 = “22”;
Integer int1 = Integer.valueOf(n1);
(++, –)
Increment and decrement operators
(+, -, *, /, %)
Arithmetic operators
(, <=, >=, ==, !=)
Comparison (Relational) operators
(&&, ||, !)
Logical operators
( =, += , -=, *=, /=, %=)
Assignment operators
Implicit casting
converting a smaller data type to a larger data type size. Performed
automatically by the compiler
byte number1 = 45;
int number2 = number1
Explicit casting
converting a larger data type to a smaller data type size and performed manually
by users
double d1 = 100.0;
float f1 = (float)d1;
What are if-else statements in Java and what are they are used for?
- Java if-else statements are used to test specific conditions and they control the flow of the program based on the condition.
- It will execute a block of code if given condition is true, and another code of block if condition is false
What is break statement in Java?
break is used for termination in Java
It is used with switch statements and loops
What are wrapper classes in Java?
- Wrapper classes are object representations of primitives
- There is a wrapper class for each primitive type
- Wrapper class names are usually same as with primitive data types
Explain main() method in java?
- It is one of the most important methods in java as it tells java where the programs start
- We cannot run our programs without main method and all our programs should be in main() method
- JVM always look for this method to start running an application
What is java and javac
- javac stands for java compiler and it is used to compile source code
- java is used to run the compiled code by javac
JIT JVM JRE JDK Architecture
JDK = development tools + JRE + JVM
JRE = all the java libraries + java classes + JVM
JVM = Java Virtual Machine and it holds JIT as well
JIT
Just in Time Compiler and it stands inside the JVM.
JVM
Java Virtual Machine and used to run the programs.
JVM itself is platform dependent
JRE
Java Runtime Environment
It holds all the Java libraries and java classes. It has JVM inside
JDK
Java Development Kit and is used to create Java programs
What is Agile?
Agile is INCREMENTAL and ITERATIVE approach to manage the project.
What is SCRUM?
• Scrum is an agile process that allows us to focus on delivering the highest business value in the shortest amount of time
What is ‘User Story’?
A user story is an informal, general explanation of a software feature written from the perspective of the end-user or customer.
As a user…