SCJP: Random Stuffs #Java Short Notes #SCJP

  • An enum may NOT be declared in a method
  • An enum can be imported
  • If the JVM has a choice, it will select a method without varargs before selecting a method with varargs
  • When enums are equal, both .equals and == always return true
  • The headMap() method returns the portion of the map whose keys are less than the key sent to it
  • The asList() method of Arrays creates a fixed-size list that is backed by the array, so no additions are possible.
  • A static initialization block is a normal block of code enclosed in braces, { }, and preceded by the static keyword. Used to initialize class variables
  • All enums implicitly extend java.lang.Enum.
  • A class can extend only one other class, an interface can extend any number of interfaces
  • An interface might also contain constant definitions.
  • An abstract class that implements an interface may not implement all interface methods

From: http://sitestree.com/?p=4872
Categories:Java Short Notes, SCJP
Tags:
Post Data:2012-12-07 07:48:57

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

SCJP: Interfaces #Java Short Notes #SCJP

Interface

  • An interface is a reference type, similar to a class
  • Interfaces can contain only constants, method signatures, and nested types
  • No method is implemented
  • Interfaces cannot be instantiated
  • They can only be implemented by classes or extended by other interfaces
  • Interfaces are not part of the class hierarchy
  • A class can implement multiple interfaces

From: http://sitestree.com/?p=4867
Categories:Java Short Notes, SCJP
Tags:
Post Data:2010-01-20 15:33:28

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

SCJP: Class Declarations #Java Short Notes #SCJP

class declarations

  • Start with modifiers such as public, private followed by class keyword
  • The class name, with the initial letter capitalized
  • The name of the class’s parent (superclass), preceded by the keyword extends (if any). A class can only extend (subclass) one parent.
  • list of interfaces implemented by the class, preceded by the keyword implements (if any). A class can implement more than one interface
  • The class body, surrounded by braces, {}.
  • Class member variable declarations
    • Requires three components, in order:
    • Zero or more modifiers, such as public or private
    • The field’s type
    • The field’s name.

Abstract Classes

  • A class declared with abstract keyword is an abstract class. It may or may not include abstract methods
  • Abstract classes cannot be instantiated
  • Abstract classes can be subclassed
  • Class containing abstract methods, must be declared to be abstract
  • Abstract methods are methods declared without implementation (braces)
  • The subclass of an abstract class must provide implementations of all the abstract methods otherwise the subclass itself needs to be declared as abstract.
  • An abstract class may have static and final fields and methods. Interfaces can not
  • If an abstract class contains only abstract method declarations with no implementations, it should better be declared as an interface
  • It’s a good design to declare a common abstract class with common methods with implementations for several very related classes (will extend the abstract class)
  • An abstract class can implement an interface but are not bound to implement all interface methods

Nested Classes

  • Classes declared under another class are called nested classes
  • Two types: Static Nested: declared with static keyword, Inner Nested: declared with no static keyword
  • inner classes have access to other members of the outer class including private members
  • Static nested classes do not have access to other members of the outer class
  • Static nested classes are accessed using the outer class name such as: OuterClass.StaticNestedClass
  • To use inner classes, the outer class must be instantiated first. Then, inner object can be created as follows: OuterClass.InnerClass innerObject = outerObject.new InnerClass();
  • Local inner classes: Declared within the body of a method
  • Anonymous inner classes: Declared within the body of a method without naming it
  • Inner classes may have similar access modifiers like other outer class members
  • Why use nested classes:
    • For logically grouping classes that are only used in one place
    • It increases encapsulation.
    • May lead to more readable and maintainable code

From: http://sitestree.com/?p=4866
Categories:Java Short Notes, SCJP
Tags:
Post Data:2012-09-13 21:25:27

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

SCJP: Flow controls and exception #Java Short Notes #SCJP

Flow Control and ExceptionsFlow control statements

  • Conditional: if, if-else and switch-case
  • Looping: for, while, do-while
  • Exception handling: try-catch-finally, throw
  • Ad hoc flow control: break, continue with or without labels

switch statement

switch(expression){
case ConstantExpression: statement(s);
case ConstantExpression: statement(s);
.
.
.
default: statement(s);
}

  • expression: must be char, byte, short, or int, or a compile-time error occurs
  • long primitive can be used if type casted to int
  • Object reference cannot be used as expression
  • Every case expression must be unique
  • break statement may be used at the end of a case statement, to discontinue execution.
  • There can be at most only one default statement.
  • The order of case statements and default can be anything.

break and continue

  • A break statement transfers the control out of an enclosing statement. break used within a loop breaks the execution of the current loop. In case of nested loops, the break statement passes the control to the immediate outer loop.
  • A continue statement breaks the current iteration and moves to next iteration.
  • break and continue with labels.
    • Labels specify the target (statement) for continue and break
    • continue with label does not jump to the labeled statement but instead jumps to the end of the labeled loop.
    • Same label identifiers can be reused multiple times as long as they are not nested.
    • Label names do not conflict with the same named identifier(variable, method or class name).

Checked and Unchecked Exceptions

Checked Exceptions

  • Checked Exceptions are checked by the compiler to see if these exceptions are properly caught or specified. If not, the code will fail to compile
  • Checked exception forces client program to deal with the scenario in which an exception may be thrown
  • Checked exceptions must be either declared or caught at compile time

Unchecked Exceptions

  • Unchecked exceptions are RuntimeException and all of its subclasses.
  • Class java.lang.Error and its subclasses also are unchecked.
  • Unchecked Exceptions are not checked by the compiler.
  • Runtime exceptions do not need to be caught or declared.

From: http://sitestree.com/?p=4864
Categories:Java Short Notes, SCJP
Tags:
Post Data:2008-08-25 00:56:33

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

#Engineering: #Canada: #Job/Contract/Project: Any #Engineering: #Computer, #Electrical, #Electronics, #Civil, #Chemical, #Mechanical, #Naval, #Biomedical, and misc Engineering

Date Posted:2021-07-16 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

  1. electrical-and-electronics-10006
  2. Electrical Wire Products
  3. Fleet Lighting and Electrical Components
  4. transportation-equipment-and-spares-10029
  5. Fleet Lighting and Electrical Components
  6. architect-and-engineering-services-10048
  7. Project Electrical Engineer- Peak Shavers NF 91 Project
  8. RQQ-2020-NAFA-487: Engineering Services for Mount Joy Passing Track
  9. Engineering Services-Brown Street, Sydney Mines-Waterline Upgrade
  10. Engineering Services, CS 2-20 Twinning, North of Prince Albert
  11. Engineering Design and Contract Admin Services for Riverside Lift Station
  12. Architectural & Engineering Services for Ilavut Centre Renovation
  13. Architectural and Engineering Services
  14. Engineering and Architectural Services
  15. environmental-services-10050
  16. Prime Consultant Landscape Architecture or Civil Engineering Consultant Services for David Thompson Corridor Infrastructure Safety Upgrades
  17. natural-resources-services-10051
  18. SP22TED251 – Mechanical Site Preparation – Excavator – Kamloops
  19. Mechanical Site Preparation – Excavator – Kamloops Field Team
  20. operation-of-government-owned-facilities-10039
  21. Engineering Services for Intersection Improvement Program
  22. professional-administrative-and-management-support-services-10040
  23. Engineering Advanced Design Gap Analysis Consulting Services
  24. research-and-development-r-d-10036
  25. Software reverse engineering prototypes development (W7701-217332/A)
  26. Engineering Services for Intersection Improvement Program
  27. special-studies-and-analysis-not-r-d-10047
  28. Engineering and Architectural Services
  29. undefined-10055
  30. RQQ-2020-NAFA-487: Engineering Services for Mount Joy Passing Track
  31. Keywords Used:engineer,civil,mechanical,electrical,electronics,mechatronics,naval,biomedical,computer engineer,software engineer,civil engineer,biomedical,electrical engineer,electronics engineer,mechanical engineer,metallurgical,chemical engineer,industrial engineer,communications engineer,quality assurance engineer,Aerospace engineer,aeronautical engineer,Engineering manager,Agricultural Engineer,Automotive Engineer,Environmental Engineer,Geological Engineer,Marine Engineer,Petroleum Engineer,Acoustic Engineer,Acoustic Engineer,Aerospace Engineer,Agricultural Engineer,Applied Engineer,Architectural Engineer,Audio Engineer,Automotive Engineer,Biomedical Engineer,Chemical Engineer,Civil Engineer,Computer Engineer,Electrical Engineer,Environmental Engineer,Industrial Engineer,Marine Engineer,Materials Science Engineer,Mechanical Engineer,Mechatronic Engineer,Mining and Geological Engineer,Molecular Engineer,Nanoengineering,Nuclear Engineer,Petroleum Engineer,Software Engineer,Structural Engineer,Telecommunications Engineer,Thermal Engineer,Transport Engineer,Vehicle Engineer,engineering

    #Canada: #IT Jobs:#Consultants, #Contractors, #Analysts, #Engineers, #Developers, #Technology Consultants, #IT-Consultants Opportunities2021-07-16

    Apply yourself, or submit others as a candidate, Build a recruitment team to submit others as a candidate, submit RFP to be considered for projects in future, Try to become a vendor so that you are asked to submit consultants/resources in future

    1. edp-hardware-and-software-10034
    2. Project: tender_15205 – 21-004P Cloud-Based Web Services
    3. energy-10007
    4. Source List (SL) for Environmental Consulting Services
    5. Prime Consultant for Main Building Foundation Repairs & Site Grading
    6. fire-fighting-security-and-safety-equipment-10010
    7. Source List (SL) for Environmental Consulting Services
    8. architect-and-engineering-services-10048
    9. Consultant Team for Bridgeland Place – Affordable Housing
    10. Prime Consultant Architectural Services Social Sciences Bldg. Façade Replacement
    11. Prime Consultant Architectural Services – Social Sciences Building Facade Replacements
    12. communications-photographic-mapping-printing-and-publication-services-10042
    13. Environmental and Survey Consultant Services for Highway-774 Wildlife Road Crossing Study and Fence Line Survey
    14. PQR for Destination Development, Management Research and Analytic Consulting Services
    15. educational-and-training-services-10043
    16. Assessment Consulting Service for the Assured Income for the Severely Handicapped (AISH) Program for the Province of Alberta
    17. Anti-Racism & Anti-Discrimination Exploratory Working Group (AREWG) Consultant
    18. environmental-services-10050
    19. Environmental and Survey Consultant Services for Highway-774 Wildlife Road Crossing Study and Fence Line Survey
    20. Prime Consultant Landscape Architecture or Civil Engineering Consultant Services for David Thompson Corridor Infrastructure Safety Upgrades
    21. financial-and-related-services-10038
    22. Group Insurance Consulting (EP899-220446/A)
    23. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
    24. Request for Proposal (RFP) for Actuarial and Pension Consulting Services
    25. health-and-social-services-10052
    26. Psychology Consulting and Quality Assurance Services
    27. information-processing-and-related-telecommunications-services-10049
    28. Project: tender_15205 – 21-004P Cloud-Based Web Services
    29. REFONTE DES SITES WEB
    30. Consultant Services for an Information Technology Strategic Plan (ITSP)
    31. professional-administrative-and-management-support-services-10040
    32. Engineering Advanced Design Gap Analysis Consulting Services
    33. Prime Consultant Services for Brantford Police Services Headquarters Retrofit and Expansion
    34. special-studies-and-analysis-not-r-d-10047
    35. CONSULTING SERVICES FOR STREETSCAPE ASSESSMENT
    36. Anti-Racism & Anti-Discrimination Exploratory Working Group (AREWG) Consultant
    37. Consulting Services – Construction Material Salvage & Recycling Market Assessment
    38. #Sensor: #Canada: #Job/Contract/Project: #Sensor, #Tracking, #Fusion, #Estimation, #Surveillance, #sensor network, #target #tracking, #security 2021-07-16

      Date Posted:2021-07-16 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

      1. construction-services-10004
      2. Traffic Signal Modifications 13th St & Marine Dr West Vancouver
    39. armament-10027
    40. Signal Smoke Marine, Orange (W8486-217390/A)
    41. electrical-and-electronics-10006
    42. Surveillance of Space 2 RFI (W8474-187639/C)
    43. fire-fighting-security-and-safety-equipment-10010
    44. Smart Anti-Loitering and Security System
    45. SURVEILLANCE SYSTEM – Fisher Court – 401 Fourth Avenue W, Geraldton, 401R Fourth Avenue W, Geraldton & Collingwood Court, 610 Winnipeg Street, Schreiber
    46. information-processing-and-related-telecommunications-services-10049
    47. LEED Recognition Display
    48. maintenance-repair-modification-rebuilding-and-installation-of-goods-equipment-10054
    49. Traffic Signal and Pedestrian Crossover Installations
    50. research-and-development-r-d-10036
    51. ITS Operational Security Services
    52. Keywords Used:sensor,fusion,sensor network,tracking,target tracking,surveillance,self driving car,self-driving,estimation,security,signal processing,image processing,autonomouse vehicle,facial recognition,signal,recognition,sensor fusion

      SCJP: Garbage Collection #Java Short Notes #SCJP

      Garbage Collection

      • Java itself does memory management. You do not need to allocate memory at the time of object creation; also you do not need to free memory explicitly
      • Object is created either on the heap or on a stack
      • Memory heap: Objects created with new keyword are placed in heaps. This memory remains allocated throughout the life cycle of the object. When the object is no more referred, the memory becomes eligible for garbage collection
      • Stack: During method calls, objects are created for method arguments and method variables. These objects are created on stack. Such objects are eligible for garbage-collection when they go out of scope.
      • Garbage Collection is a low-priority thread in java
      • Garbage Collection cannot be forced explicitly. JVM may do garbage collection if it is running short of memory.
      • The call System.gc() does NOT force the garbage collection but only suggests that the JVM may make an effort to do garbage collection.
      • Garbage Collection is hardwired in Java runtime system. Java runtime system keeps the track of memory allocated. Therefore, it is able to determine if memory is still usable by any live thread. If not, then garbage collection thread will eventually release the memory back to the heap.
      • Garbage Collection usually adopts an algorithm, which gives a fair balance between responsiveness (how quickly garbage-collection thread yields?) and speed of memory recovery (important for memory-intensive operations). Responsiveness is especially important in real time systems.
      • An object is eligible for garbage collection when no object refers to it.
      • An object also becomes eligible when its reference is set to null. (Actually all references to the object should be null for it to be eligible.)
      • The objects referred by method variables or local variables are eligible for garbage collection when the method or their container block exits

      From: http://sitestree.com/?p=4863
      Categories:Java Short Notes, SCJP
      Tags:
      Post Data:2009-03-10 13:59:45

      Shop Online: https://www.ShopForSoul.com/
      (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
      In Bengali: http://Bangla.SaLearningSchool.com
      http://SitesTree.com
      8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
      Shop Online: https://www.ShopForSoul.com/
      Medium: https://medium.com/@SayedAhmedCanada

      SCJP: Language Fundamentals #Java Short Notes #SCJP

      Class declaration and java source file.

      • Only “one” top-level public class is allowed per java source file.
      • The name of the java source file and the name of the top-level public class MUST be the same.
      • If no public class is there in a file, after compiling separate class files will be created for all classes in the file.
      • Package statement, import statements and class definition MUST appear in the order given.

      Keywords and Identifiers

      • Keywords are always in a lower case.
      • Some keywords: const, goto, strictfp, and volatile
      • Identifiers must start with either letter, $ or _ (underscore) and can have letter, $, _ or digits in it.
      • no keyword is allowed as identifiers
      abstract do import public transient
      boolean double instanceof return try
      break else int short void
      byte extends interface static volatile
      case final long super while
      catch finally native switch
      char float new synchronized
      class for package this
      continue if private throw
      default implements protected throws

      Default Values, Local Variables

      • Each primitive data type has a default value specified. Variable of primitive data type may be initialized
      • Only class member variables are automatically initialized. Method variables need explicit initialization
      • Local variables (also known as automatic variables) are declared in methods and in code blocks
      • Automatic variables are not automatically initialized
      • local variables should be explicitly initialized before first use. These are automatically destroyed when they go out of scope

      Arrays

      • Fixed-sized ordered collection of homogeneous data elements
        int[] ints; // array declaration
        ints = new ints[25]; // array construction at runtime.
      • Array declared, constructed and initialized at the same time.
        int[] ints = {1,2,3,4,5}; // array declaration,
      • An array of primitive data type created using the new keyword is automatically initialized. Each array element is initialized to its default value.
        For example,
        char[] arrayOfChars = new char[10];
      • Array of object references: An array of object references created using the new keyword is also initialized. Each array element is initialized to its default value, i.e. null.
        String[] names = new String[10];
      • length is a property of array (and not a method)
      • java.lang.Object is the superclass of an array

      Argument passing during method calls

      • Always a copy of argument value is passed to calling method
      • Arguments of primitive data types: first, a copy of the passing variable is made and then it is passed. The original copy remains unaffected
      • Object reference as an argument: A copy of object reference is passed for method calls. It still points to the same object. The original copy is affected.

      From: http://sitestree.com/?p=4862
      Categories:Java Short Notes, SCJP
      Tags:
      Post Data:2008-07-28 12:18:41

      Shop Online: https://www.ShopForSoul.com/
      (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
      In Bengali: http://Bangla.SaLearningSchool.com
      http://SitesTree.com
      8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
      Shop Online: https://www.ShopForSoul.com/
      Medium: https://medium.com/@SayedAhmedCanada

      SCJP: Java Operators #Java Short Notes #SCJP

      Exams like SCJP test your understanding of Java operators and how to use them like:
      assignment operators: =, +=, -=
      arithmetic operators: +, -, *, /, %, ++, —
      relational operators: < , , >=, ==, !=
      logical operators: &, |, ^, !, &&, ||
      conditional operators: ? :
      Also operators to check the equality of two objects or two primitives

      In the following table operators and their precedences are shown. Upper rows operators have higher precedence. Same row operators have equal precedence. For equal precedence operators, All binary operators except the assignment operators work from left to right while assignment operators work from right to left.

      Operator Precedence
      Operators Precedence
      postfix expr++ expr--
      unary ++expr --expr +expr -expr ~ !
      multiplicative * / %
      additive + -
      shift < > >>>
      relational = instanceof
      equality == !=
      bitwise AND &
      bitwise exclusive OR ^
      bitwise inclusive OR |
      logical AND &&
      logical OR ||
      ternary ? :
      assignment = += -= *= /= %= &= ^= |= < >= >>>=

      The following quick reference summarizes the operators supported by the Java programming language.

      Simple Assignment Operator

      =	Simple assignment operator

      Arithmetic Operators

      + 	Additive operator (also used for String concatenation)- 	Subtraction operator*	Multiplication operator/ 	Division operator%	Remainder operator

      Unary Operators

      + 	Unary plus operator; indicates positive value (numbers are positive without this, however)- 	Unary minus operator; negates an expression++  	Increment operator; increments a value by 1--    	Decrement operator; decrements a value by 1!     	Logical compliment operator; inverts the value of a boolean

      Equality and Relational Operators

      ==	Equal to!=	Not equal to>	Greater than>=	Greater than or equal to< Less than<=	Less than or equal to

      Conditional Operators

      && 	Conditional-AND|| 	Conditional-OR?:      Ternary (shorthand for if-then-else statement)

      Type Comparison Operator

      instanceof	Compares an object to a specified type 

      Bitwise and Bit Shift Operators

      ~	Unary bitwise complement< >	Signed right shift>>>	Unsigned right shift&	Bitwise AND^	Bitwise exclusive OR|	Bitwise inclusive OR

      Details about java operators

      From: http://sitestree.com/?p=4848
      Categories:Java Short Notes, SCJP
      Tags:
      Post Data:2012-12-29 02:01:30

      Shop Online: https://www.ShopForSoul.com/
      (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
      In Bengali: http://Bangla.SaLearningSchool.com
      http://SitesTree.com
      8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
      Shop Online: https://www.ShopForSoul.com/
      Medium: https://medium.com/@SayedAhmedCanada