#difference between array and arraylist in java
Explore tagged Tumblr posts
Text
Nagarro Java developer Interview Questions
1. Difference in ArrayList and Hashset Some difference between ArrayList and Hashset are: - ArrayList implements List interface while HashSet implements Set interface in Java. - ArrayList can have duplicate values while HashSet doesn’t allow any duplicates values. - ArrayList maintains the insertion order that means the object in which they are inserted will be intact while HashSet is an unordered collection that doesn’t maintain any insertion order. - ArrayList is backed by an Array while HashSet is backed by an HashMap. - ArrayList allow any number of null value while HashSet allow one null value. - Syntax:- ArrayList:-ArrayList list=new ArrayList(); - HashSet:-HashSet set=new HashSet(); 2. Using Lambda Function print given List of Integers import java.util.*; public class Main { public static void main(String args) { List arr = Arrays.asList(1,2,3,4); arr.forEach(System.out::println); arr.stream().forEach(s->System.out.println(s)); } } Output 1 2 3 4 3. new ArrayList(2); What does this mean? 4. Difference in Synchronization and Lock Differences between lock and synchronized: - with locks, you can release and acquire the locks in any order. - with synchronized, you can release the locks only in the order it was acquired. 5. What is Closeable interface? A Closeable is a source or destination of the data that needs to be closed. The close() method is invoked when we need to release resources that are being held by objects such as open files. The close() method of an AutoCloseable object is called automatically when exiting a try -with-resources block for which the object has been declared in the resource specification header. Closeable is defined in java.io and it is idempotent. Idempotent means calling the close() method more than once has no side effects. Declaration public interface Closeable extends AutoCloseable { public void close() throws IOException; } Implementing the Closeable interface import java.io.*; class Main { public static void main(String s) { try (Demo1 d1 = new Demo1(); Demo2 d2 = new Demo2()) { d1.show1(); d2.show2(); } catch (ArithmeticException e) { System.out.println(e); } } } //Resource1 class Demo1 implements Closeable { void show1() { System.out.println("inside show1"); } public void close() { System.out.println("close from demo1"); } } //Resource2 class Demo2 implements Closeable { void show2() { System.out.println("inside show2"); } public void close() { System.out.println("close from demo2"); } } Output inside show1 inside show2 close from demo2 close from demo1 6. What are Lambda Functions? A lambda expression is a block of code that takes parameters and returns a value. Syntax of Lambda Expression Lambda expression contains a single parameter and an expression parameter -> expression Lambda expression contains a Two parameter and an expression (parameter1, parameter2) -> expression Expressions cannot contain variables, assignments or statements such as if or for. If you wanted to do some more complex operations, a code block can be used with curly braces. If the lambda expression needs to return a value, then the code block should have a return statement. (parameter1, parameter2) -> { code block } import java.util.ArrayList; public class Main { public static void main(String args) { ArrayList list = new ArrayList(); list.add(1); list.add(2); list.add(3); list.add(4); list.forEach( (n) -> { System.out.println(n); } ); } } Output 1 2 3 4 7. What are @Component and @Service used for? @Component @Component annotation is used across the application to mark the beans as Spring's managed components. Spring check for @Component annotation and will only pick up and register beans with @Component, and doesn't look for @Service and @Repository in general. @Repository @Repository annotation is used to indicate that the class provides the mechanism for storage, retrieval, search, update and delete operation on objects. @Service We mark beans with @Service to indicate that they're holding the business logic. Besides being used in the service layer, there isn't any other special use for this annotation. 8. Why 'get' type in REST API called idempotent? An idempotent HTTP method is a method that can be invoked many times without the different outcomes. It should not matter if the method has been called only once, or ten times over. The result should always be the same. - POST is NOT idempotent. - GET, PUT, DELETE, HEAD, OPTIONS and TRACE are idempotent. - A PATCH is not necessarily idempotent, although it can be. 9. Working of HashMap HashMap contains an array of Node and Node can represent a class having the following objects : - int hash - K key - V value - Node next 10. What are different types of method in REST API? Some different types of REST API Methods are GET, POST, PUT, PATCH, DELETE. 11. How to load application.yml file in application. To Work with application.yml file, create a application.yml in the src/resources folder. Spring Boot will load and parse yml file automatically and bind the values into the classes which annotated with @ConfigurationProperties 12. /users/:id and /user/name={"Saurabh"} convert into API 13. What is Transaction Management in Spring? A database transaction is a sequence of actions that are treated as a single unit of work. These actions should either complete entirely or take no effect at all. Transaction management is an important part of RDBMS-oriented enterprise application to ensure data integrity and consistency. The concept of transactions can be described with the following four key properties described as ACID - Atomicity − A transaction should be treated as a single unit of operation, which means either the entire sequence of operations is successful or unsuccessful. - Consistency − This represents the consistency of the referential integrity of the database, unique primary keys in tables, etc. - Isolation − There may be many transaction processing with the same data set at the same time. Each transaction should be isolated from others to prevent data corruption. - Durability − Once a transaction has completed, the results of this transaction have to be made permanent and cannot be erased from the database due to system failure. 14. How to load application.yml file in application? Ans: @EnableConfigurationProperties 15. Backward Compatibility of Java 1.8 Java versions are expected to be binary backwards-compatible. For example, JDK 8 can run code compiled by JDK 7 or JDK 6. It is common to see applications leverage this backwards compatibility by using components built by different Java version. A Compatibility Guide (explained later) exists for each major release to provide special mention when something is not backwards compatible. The backwards compatibility means that you can run Java 7 program on Java 8 runtime, not the other way around. 16. Input- Output- How to do this? import java.util.*; class Main { public static void main(String s) { ArrayList arr = new ArrayList(Arrays.asList(4,2,6,8,9,1,3,4)); Set set = new HashSet(); set.addAll(arr); arr.clear(); arr.addAll(set); System.out.println(arr); } } Output 17. Default size of HashSet? Default size of HashSet is 16. 18. What is Functional Interface and it's example? Functional Interface is a Interface that contains only one abstract method. It can contains any number of default, static methods but can have only one abstract method. Abstract method is a method that does not have a body. @FunctionalInterface interface CustomFunctionalInterface { void display(); } public class Main { public static void main(String args) { CustomFunctionalInterface functionalInterface = () -> { System.out.println("Functional Interface Example"); }; functionalInterface.display(); } } Output Functional Interface Example 19. Difference between Encapsulation and Data Hiding.
Key Differences Between Data Hiding and Encapsulation
- Encapsulation deals with hiding the complexity of a program. On the other hand, data hiding deals with the security of data in a program. - Encapsulation focuses on wrapping (encapsulating) the complex data in order to present a simpler view for the user. On the other hand, data hiding focuses on restricting the use of data, intending to assure the data security. - In encapsulation data can be public or private but, in data hiding, data must be private only. - Data hiding is a process as well as a technique whereas, encapsulation is subprocess in data hiding. 20. What are generics? Generics means parameterized types. The idea is to allow type (Integer, String, … etc., and user-defined types) to be a parameter to methods, classes, and interfaces. Using Generics, it is possible to create classes that work with different data types. An entity such as class, interface, or method that operates on a parameterized type is a generic entity. class GenericTest { T obj; GenericTest(T obj) { this.obj = obj; } public T getObject() { return this.obj; } } class Main { public static void main(String args) { GenericTest obj1 = new GenericTest(10); System.out.println(obj1.getObject()); GenericTest obj2 = new GenericTest("Generic Example"); System.out.println(obj2.getObject()); } } Output 10 Generic Example Read the full article
#interviewpreparation#mncsjavainterviewpreparation#nagarro#nagarrojavadeveloper#servicebasedinterviewpreparation
0 notes
Text
Parameterized Types
The main difference between true generic programming and the ArrayList examples in the previous subsection is the use of the type Object as the basic type for objects that are stored in a list. This has at least two unfortunate consequences: First, it makes it necessary to use type-casting in almost every case when an element is retrieved from that list. Second, since any type of object can legally be added to the list, there is no way for the compiler to detect an attempt to add the wrong type of object to the list; the error will be detected only at run time when the object is retrieved from the list and the attempt to type-cast the object fails. Compare this to arrays. An array of type BaseType[ ] can only hold objects of type BaseType. An attempt to store an object of the wrong type in the array will be detected by the compiler, and there is no need to type-cast items that are retrieved from the array back to type BaseType.
To address this problem, Java 5.0 introduced parameterized types. ArrayList is an ex-ample: Instead of using the plain “ArrayList” type, it is possible to use ArrayList, where BaseType is any object type, that is, the name of a class or of an interface. (BaseType cannot be one of the primitive types.) ArrayList can be used to create lists that can hold only objects of type BaseType. For example,
ArrayList rects;
declares a variable named rects of type ArrayList, and
rects = new ArrayList();
sets rects to refer to a newly created list that can only hold objects belonging to the class ColoredRect (or to a subclass). The funny-looking name “ArrayList” is being used here in exactly the same way as an ordinary class name—don’t let the “” confuse you; it’s just part of the name of the type. When a statement such as rects.add(x); occurs in the program, the compiler can check whether x is in fact of type ColoredRect. If not, the compiler will report a syntax error. When an object is retrieve from the list, the compiler knows that the object must be of type ColoredRect, so no type-cast is necessary. You can say simply:
ColoredRect rect = rects.get(i)
You can even refer directly to an instance variable in the object, such as rects.get(i).color. This makes using ArrayList very similar to using ColoredRect[ ] with the added advantage that the list can grow to any size. Note that if a for-each loop is used to process the items in rects, the type of the loop control variable can be ColoredRect, and no type-cast is necessary.
Visit more Information: https://www.wikiod.com/w/Category:Java_Language
0 notes
Text
Complete Core Java Topics List | From Basic to Advanced Level [2021]
Attention Dear Reader, In this article, I will provide you a Complete Core Java Topics List & All concepts of java with step by step. How to learn java, when you need to start, what is the requirement to learn java, from where to start learning java,and Tools to Understand Java code. every basic thing I will include in this List of java.
core java topics list Every beginner is a little bit confused, at the starting point before learning any programming language. But you no need to worry about it. Our aim to teach you to become a good programmer. In below you can start with lesson 1 or find out the topics manually. it’s your choice.
Complete Core Java Topics List.
Chapter. 1Full Basic Introduction of java.1.1What is java?1.2Features if java?1.3What is Software?1.4What are Programs?1.5Need to know about Platforms.1.6Object Orientation.1.7What are objects in java?1.8Class in java.1.9Keywords or Reserved words of java.1.10Identifiers in java.1.11Naming convention / coding Standard.1.12Association (Has-A Relationship).1.13Aggregation and Composition in java.1.14Java Compilation process.1.15WORA Architecture of java.1.16What is JVM, JRE and JDK in java?Chapter. 2Classes and Objects in Detail2.1How to create Class?2.2How to Create Objects?2.3Different ways to create objects in class.2.4object Reference / object Address.2.5Object States and Behavior.2.6Object Creation & Direct Initialization.2.7Object initialization using Reference.Chapter. 3Data Types in Java.3.1Java Primitive Data Types.3.2Java Non-Primitive Data Types.Chapter. 4Instance Method.4.1Types of methods in java.4.2Rules of Methods.4.3How to use methods in a class.Chapter. 5Class Loading in Java?5.1What is Class Loading.5.2Class Loading Steps.5.3Program Flow explanation.5.4"this" Keyword in java?Chapter. 6Variables in java.6.1Types of Variables.6.2Scope of variables.6.3Variable initialization.Chapter. 7Variable Shadowing in Java?Chapter. 8 Constructors in java.8.1Rules for creating java Constructors.8.2Types of Construstors.8.3Difference between Constructor and method in java.Chapter. 9Categories of methods in java.9.1Abstract Method in java.9.2Concrete Method in java.Chapter. 10Overloading in java.10.1Types if Overloading.10.2Advantages and Disadvantages of overloading.10.3Can we overload main( ) method in java?10.4Constructor Overloading in java.Chapter. 11Inheritance in java?11.1Types of Inheritance.11.2Terms used in inheritance.11.3The syntax of java inheritance.11.4How to use Inheritance in java/Chapter. 12Overriding in java.12.1Usage of java method Overriding.12.2Rules of method Overriding.12.3Importance of access modifiers in overriding.12.4Real example of method Overriding.12.5Difference between method overriding and overloading java.12.6"Super" keyword in java.Chapter. 13Constructor chaining in java.13.1Generalization in java with Example.Chapter. 14Type-Casting in java.14.1Primitive and Non-Primitive Casting in java.14.2Data Widening and Data Narrowing in java.14.3Up-Casting in java.14.4Down-Casting in java.14.5Characteristics of Up-Casting.Chapter. 15Garbage Collection.15.1Advantages of Garbage Collection.15.2How can an object be unreferanced in java?15.3Some examples of Garbage Collection in java.Chapter. 16Wrapper Class in java.16.1Uses of wrapper class in java.16.2How to Convert Primitive form to object form.16.3How to Convert String form to Primitive form.16.4Learn public static xxx parsexxx(Strings srop).16.5Autoboxing in java.16.6Unboxing in java.Chapter. 17Polymorphism in java?17.1Compile time polymorphism.17.2Runtime Polymorphism.Chapter. 18Packages in java?18.1Advantages of Packages in java.18.2Standard Package structure if java Program.18.3How to access package from another package?18.4Inbuilt package in java?18.5What are Access Modifiers In java.18.6Types of Access Modifires.Chapter. 19Encapsulation in java.19.1Advantages of Encapsulation in java?19.2Java Bean Specification or Guidelines.Chapter. 20Abstraction in java.20.1What are abstract methods in java?20.2Abstract Class in java?20.3Difference between Abstract class and Concrete class.20.4Similarities between Abstract and Concrete class?20.5Interface in java?20.6Why use java interface?20.7How to declare an interface in java?20.8Types of Interface in java?20.9What are the uses of Abstraction?20.10Purpose or Advantages of Abstraction.Chapter. 21Collection Framework in java?21.1What is collection in java?21.2What is framework in java?21.3Advantages of collection over an array in java.21.4Collection Framework Hierarchy in java.21.5Generics in java?21.6List Interface in java.21.7Methods of List Interfae in java.21.8ArrayList in java?21.9Vector in java.21.10Difference between ArrayList and Vector.21.11LinkedList in Java.21.12Difference between ArrayList and LinkedList.21.13Iterating Data from List.21.14foreach Loop in java.21.15Difference between for loop and foreach loop.21.16Set Interface in java.21.17Has-based Collection in java.21.18What are HashSet in java?21.19What are LinkedHashSet in java?21.20What are TreeSet in Java?21.21Iterator interface in java.21.22Iterator Methods in java.21.23ListIterator interface in java.Chapter. 22What are Map in java?22.1Map interface method in java.22.2What are HashMap in java?22.3What are LinkedHashMap in java?22.4What are TreeMap in java?22.5HashTable in java?22.6ShortedMap in java?22.7Difference between HashMap and Hashtable in java?22.8Comparable and Comparator in java?22.9Where Comparable and Comparator is used in java?22.10What is Comparable and Comparator interface in java?Chapter. 23Exception Handling in Java.23.1Exception Hierarchy in java.23.2Checked and Unchecked Exception in java?23.3Java Try Block?23.4java catch Block?23.5Multi-catch block in java?23.6Sequence of catch Block in java?23.7Finally Block in java?23.8"throws" keyword in java?23.9"throw" keyword in java?23.10Difference between throw and throws in java.23.11Custom and user defined exception in java?23.12Difference between final, finally and finalize in java?Chapter. 24Other Advanced Topics24.1Advanced Programming Java Concepts"👆This is the Complete Core Java Topics List"
How to Learn Java Step by Step?
We know that java is the most popular programming language on the internet. and also know this is the most important language for Android Development. with the help of java, we can develop an Android application. All over the topics will helps you to understated the basic concepts to learn java step by step. which helps you to understand the structure of any application backend code for app development. we recommended you to do more practice of all concepts and topics list. which is given over to becoming a good java developer. Must Read: What is Java, Full Introduction of Java for Beginners with Examples?
What is a Programming Language?
In short, Any software language. which is used in order to build a program is called a programming language. Java is also an object-oriented programming language. using that we can develop any type of software or web application. Is it easy to learn Java?

Is it easy to learn Java? My answer is "yes". Java is a beginner-friendly programming language. Because Every beginner easily learns java programming language. that means you don't need to give much effort to learn. you can start from a lower level to a higher level. Also, it provides you a user-friendly environment to develop software for clients. it has a garbage collector, which helps a lot to manage the memory space of your system for better performance. Tools to Understand Java Code. The market has lots of tools for programming. as a beginner, I will be recommending some Cool tools for Java Programming, which helps you to write and execute codes easily. 1. Eclipse: This is one of my favorite tools for practicing java codes. it will provide an integrated development environment for Java. Eclipse proved us so many interesting & modern features, modeling tools, testing tools. and frameworks development environment.

this Tools helps you to Understand Java Code. Here is Some Features of Eclipse: - User-Friendly Interface. - Provides a Model-Driven Development environment. - Easy integration with JUnit. - you can code faster with the Short-cuts. - Provide Complete reports in detail. - easy customization. with the Ctrlflow Automated Error Reporting Server. - Eclipse Provides the best tooling system for J2EE projects. - You can Download free. 2. JUnit: it is an open source unit for testing tool for Java programs. It is test-driven development and software deployment.

this Tools helps you to Understand Java Code. Here is Some Features of JUnit: - Prepare for input data and setup. - Some creation of fake objects. - Automatic Loading databases with a specific set of data - offers annotations, that test classes fixture, that's run before or after every test - support for write and execute tests on the platform. - Have some annotations to identify test methods - we can write codes faster, which increases the quality of codes and practices. - You can Download free Also Read: How to Download and Install Java JDK 15 in Windows 10 ? How longs to learn java? Every beginner student had pinged this question. How longs to learn java? now I will tell you according to the research. the speed of learning technologies and related subjects depends on the regularity of studies and the initial capacity of every student. I know you can do anything with your initial capacity level. but the regular study is a big responsibility of every student. I will recommend practicing daily to improve your programming skills and java concepts knowledge. and get stay motivated with your goals. definitely it will help you to get your first job. Note:- if any person has a little bit of programming knowledge, honestly it would take around 1 month to learn the basic concepts of java. if you are from a non-programming background but have a good knowledge of basic mathematics. definitely, you can also learn and understand fast all the concepts of java. it will all depend on your problem-solving skills and understanding concepts. Conclusions: At the starting of the article, I will provide you a complete core java topics list. it will help you to understand, where you need start, this is the basic step for a beginner. and also provides some tools for your practicing. I hope now you can start lean java with you motivation. Admin Word:- In this article, I provided A Complete Core Java Topics List. and also give your all pinged questions answers such as How to Learn Java Step by Step?, What is a Programming Language, Is it easy to learn Java, How longs to learn java. Also provides some free Tools to Understand Java Code which helps to Learn Java Step by Step. if you have any questions regarding this article please feel free to ask in the comment below of this article. Read the full article
0 notes
Text
CS526 Homework Assignment 6 Solution
This assignment has two parts. Part 1 is an experiment that compares insertion times and search times of hash data structure, array list data structure, and linked list data structure. Part 2 is an experiment that compares the running times of four different sorting algorithms.
Part 1 (50 points)
The goal of Part 1 is to give students an opportunity to observe differences among three data structures in Java – HashMap, ArrayList, LinkedList – in terms of insertion time and search time. Students are required to write a program named InsertSearchTimeComparison.java that implements the following pseudocode: create a HshMap instance myMap create an ArrayList instance myArrayList create a LinkedList instance myLinkedList Repeat the following 10 times and calculate average total insertion times and average total search times for all three data structures generate 100,000 random integers in the range and store them in the array of integers keys // Insert keys one at a time but measure only the total time (not individual insert // time) // Use put method for HashMap // Use add method for ArrayList and Linked List insert all keys in keys into myMap and measure the total insert time insert all keys in keys into myArrayList and measure the total insert time insert all keys in keys into myLinkedList and measure the total insert time // after insertion, keep the three data structures with all inserted keys. generate 100,000 random integers in the range and store them in the array keys // Search keys one at a time but measure only total time (not individual search // time) // Use containsKey method for HashMap // Use contains method for ArrayList and Linked List search myMap for all keys in keys and measure the total search time search myArrayList for all keys in keys and measure the total search time search myLinkedList for all keys in keys and measure the total search time Print your output on the screen using the following format: Number of keys = 100000 HashMap average total insert time = xxxxx ArrayList average total insert time = xxxxx LinkedList average total insert time = xxxxx HashMap average total search time = xxxxx ArrayList average total search time = xxxxx LinkedList average total search time = xxxxx You can generate n random integers between 1 and N in the following way: Random r = new Random(System.currentTimeMillis() ); for i = 0 to n – 1 a = r.nextInt(N) + 1 When you generate random numbers, it is a good practice to reset the seed. When you first create an instance of the Random class, you can pass a seed as an argument, as shown below: Random r = new Random(System.currentTimeMillis()); You can pass any long integer as an argument. The above example uses the current time as a seed. Later, when you want to generate another sequence of random numbers using the same Random instance, you can reset the seed as follows: r.setSeed(System.currentTimeMillis()); You can also use the Math.random( ) method. Refer to a Java tutorial or reference manual on how to use this method. We cannot accurately measure the execution time of a code segment. However, we can estimate it by measuring an elapsed time, as shown below: long startTime, endTime, elapsedTime; startTime = System.currentTimeMillis(); // code segment endTime = System.currentTimeMillis(); elapsedTime = endTime ‐ startTime; We can use the elapsedTime as an estimate of the execution time of the code segment.
Part 2 (50 points)
The goal of part 2 is to give students an opportunity to compare and observe how running times of sorting algorithms grow as the input size grows. Since it is not possible to measure an accurate running time of an algorithm, you will use an elapsed time as an approximation as as described in the Part 1. Write a program named SortingComparison.java that implements four sorting algorithms for this experiment: insertion-sort, merge-sort, quick-sort and heap-sort. A code of insertion-sort is in page 111 of our textbook. An array-based implementation of merge-sort is shown in pages 537 and 538 of our textbook. An array-based implementation of quick-sort is in page 553 of our textbook. You can use these codes, with some modification if needed, for this assignment. For heap-sort, our textbook does not have a code. You can implement it yourself or you may use any implementation you can find on the internet or any code written by someone else. If you use any material (pseudocode or implementation) that is not written by yourself, you must clearly show the source of the material in your report. A high-level pseudocode is given below: for n = 10,000, 20,000, . . ., 100,000 (for ten different input sizes) Create an array of n random integers between 1 and 1,000,000 Run insertionsort and calculate the elapsed time // make sure you use the initial, unsorted array Run mergesort and calculate the elapsed time // make sure you use the initial, unsorted array Run quicksort and calculate the elapsed time // make sure you use the initial, unsorted array Run heapsort and calculate the elapsed time Note that it is important that you use the initial, unsorted array for each sorting algorithm. So, you may want to keep the original array and use a copy when you run each sorting algorithm. You can calculate the elapsed time of the execution of a sorting algorithm in the following way: long startTime = System.currentTimeMillis(); call a sorting algorithm long endTime = System.currentTimeMillis(); long elapsedTime = endTime ‐ startTime; Collect all elapsed times and show the result (1) as a table and (2) as a line graph. The table should look like: n Algorithm 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000 insertion merge quick heapsort Entries in the table are elapsed times in milliseconds. The line graph shows the same information but as a graph with four lines, one for each sorting algorithm. The x-axis of the graph is the input size n and the y-axis of the graph is the elapsed time in milliseconds. An example graph is shown below:
Deliverables
You need to submit program files and a documentation files. Two program files to be submitted are InsertSearchTimeComparison.java and SortingComparison.java files. If you have other files that are necessary to compile and run the two programs, you must submit these additional files too In a documentation file, you must include, for each part, your conclusion/observation/discussion of each experiment. Combine all program files, additional files (if any), and the documentation file into a single archive file, such as a zip file or a rar file, and name it LastName_FirstName_hw6.EXT, where EXT is an appropriate file extension (such as zip or rar). Upload it to Blackboard.
Grading
For both parts, there is no one correct output. As far as your output is consistent with generally expected output, no point will be deducted. Otherwise, 10 points will be deducted for each part. If your conclusion/observation/discussion is not substantive, points will be deducted up to 10 points. If there is no sufficient inline comments, points will be deducted up to 20 points. Read the full article
0 notes
Text
48 C# Interview Questions Any Interview Worth Their Salt Will Ask
With over 7,000 C#.Net programming jobs advertised every month that have an average salary of over $90,000, the demand for this type of developer has exploded. But why is the C#.Net labor market so hot right now? Well, more and more engineering departments are adopting C#.Net to build their software because it's similar to other common C-type languages like C++ and Java. This makes the language intuitive to learn -- in fact -- it's the fifth most popular programming language for building software.
To help you prepare for your next C#.Net developer interview and land the job, check out the following C#.Net interview questions most interviewers will ask you.
48 C#.Net Interview Questions
1. What is C#?
2. What are the advantages of using C#?
3. What are an object and class?
4. What is an Object Pool?
5. What is an abstraction?
6. What is polymorphism?
7. Is C# managed or unmanaged code?
8. How do you inherit a class in C#?
9. What’s the difference between Interface and Abstract Class?
10. What are sealed classes in C#?
11. What’s the difference between a struct and a class in C#?
12. What’s the point of using statement in C#?
13. How is Exception Handling applied in C#?
14. What are boxing and unboxing in C#?
15. What are the three types of comments in C#?
16. Can multiple catch blocks be executed in C#?
17. What’s the difference between static, public, and void? What’s the outcome of each one?
18. What are value types and reference types?
19. What’s the difference between ref and out parameters?
20. Can “this” be used within a static method?
21. What are Arrays in C#?
22. What is a jagged array in C#?
23. What’s the difference between Array and ArrayList?
24. What’s the difference between System.Array.CopyTo() and System.Array.Clone()?
25. What’s the difference between string and StringBuilder?
26. What are delegates in C#?
27. What’s a multicast delegate?
28. What is a Reflection in C#?
29. What is a Generic Class?
30. What are Get and Set Accessor properties?
31. What is Multithreading?
32. What is Serialization?
33. What are the different ways a method can be overloaded?
34. What is the accessibility modifier “protected internal”?
35. What are the different ways a method can be overloaded?
36. What is an object pool in .Net?
37. What are the most commonly used types of exceptions in .Net?
38. What are accessibility modifiers in C#?
39. What are nullable types in C#?
40. What’s the difference between is and as operators in C#?
41. What are Indexers?
42. What are Singleton Design Patterns?
43. Given an array of ints, write a C# method to total all the values that are even numbers.
44. Is it possible to store mixed data types like int, string, float, and char all in one array?
45. Describe dependency injection.
46. Write a C# program that accepts a distance in kilometers, converts it into meters, and then displays the result.
47. What’s the difference between the “constant” and “readonly” variables when using C#? When would you use each one?
48. Which preference of IDE do you have when using C#? Why?
from Marketing https://blog.hubspot.com/marketing/c-interview-questions
0 notes
Text
95% off #The Complete Android & Java Developer Course – Build 21 Apps – $10
Learn Android Development, Java & Android Studio from Scratch in 5 Weeks. Build Whatsapp Clone, Diary App & Android Apps
28 hours, – 3 coding exercises, 201 lectures
Average rating 4.3/5 (4.3 (1,247 ratings) Instead of using a simple lifetime average, Udemy calculates a course’s star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.)
Course requirements:
This course is highly recommended for you if you’ve never written a line of code No programming experience is required A PC or MAC with internet connection Passion for learning android app development with Java
Course description:
Are you Looking to boost your income as an Android Developer? Maybe you have a lot of app ideas but don’t know where to start? Or you are seeking a career in Android Development and Java Programming that will finally give you freedom and flexibility you have been looking for?
Build a strong foundation in Android Development, Android Studio and object-oriented Java Programming with this tutorial and complete course.
Build Android apps from scratch using Android Studio and Java Programming Upload your apps to Google Play and reach Millions of Android users Make Money from your apps by displaying ads. (How To Monetize Apps)
Content and Overview
This course will take you from knowing nothing about Android development to a complete Android developer in 5 weeks. You will learn the following:
Android Studio and build User Interface (Set up and walkthrough) Fundamentals of Java Programming used to build Android apps Inputs, Buttons and Reactive (Tap) Interfaces Android Building blocks Variables, Arrays, Loops, ArrayLists, ListView Navigate between screens Passing information between screens Learn how professional android apps developers think and work Learn how to design android apps Build several amazing apps – Hands on Publish your apps on Google Play Build Sound Box app Build WhatsApp Clone Earn Money from your Android apps – How to integrate ads in your apps And Learn much more by Building 21 Real World Apps …
WHY ANDROID?
Android is known to be one of the most versatile and most used operating systems. We are in the age where every other person uses a handheld device or a cell phone which makes use of Android. If one goes deep into the world of android, we would see that there is a scope and a lot of potential in the world of android for individuals who are tech geeks (like us)! As vast this world this, learning about it as simple and as easy as a piece of cake. You can make your own app easily and show your true potential to the world of google and android.
Here are some numbers to get you in the mood!
DID YOU KNOW? Android is the primary operating system for over 90 tablets, for 6 E-Readers and 300 smartphones. There are over 1,460,800 apps in Google Play store &they’re growing at an astounding pace! Every day about 1.5 million Android devices are activated all around the world. About 60% of the apps available at the Google play store are absolutely free!
Why learn android development? Learning android development is both fun and can reap you many profits in the long run. It is said that by the year 2018, there will be about 4 billion android users, hence doubling the current market. It is safe to say that android development has a potential and can reap you various benefits in the long run. If one knows android development, not only will you be having a stable and sound career but can unleash you hidden talents as a developer.
Course description if you take this course (which you should!!) know that you are on your way to building a solid and stable foundation for Android Development, Android Studio and object-oriented Java Programming. You don’t need to spend years and years on learning, with us you can learn in 5 weeks!!!! YES! That is right, in five weeks you’ll be able to make and develop your own app and you never know, you could have it running at the app store and be an instant hit!
We have built this course in a way that everything that you learn, you will be able to retain it for a long time. This is why we have distributed the whole course into various sections and not sessions. The reason why we did this is because our course is live and ON DEMAND. Once you buy this course, you have LIFETIME ACCESS to it. You can always refer back to any section that you want to revise and move along. Every section of ours has been built to test your ability. You not only get the content but also are given quizzes and assignments to ensure that what you have learnt is retai
Reviews:
“Good training, does the job (Android part). If you want learn Java – pick different course. -0.5* for 15 seconds of silence at the beginning and end of each lesson -0.5* for coding standards (or lack of them) – it hurts my eyes ;)” (Arkadiusz Wiertlewski)
“I am really enjoying this course. The course instructor is doing a great job. Welldone Paulo you make this course interesting and your explanation is very good. Thank you.” (Adeyemi Adebayo)
“has a good style and the instructions are covering some of the small details that can cause issues if not aware. Covers a good number of classes and examples. The material is built up in a logical manner. Covers more than just elementary topics. Pays attention to details.” (Otto Lecuona)
About Instructor:
Fahd Sheraz Paulo Dichone
A Developer and Teacher who is passionate about building web & mobile apps. I have a MSC degree in Computer Science (Internet Engineering) from United Kingdom. I started programming in 1995 and wrote my first program using DOS (Black command screen) and the First GUI used was Windows 95. Built a wide range of systems for companies in USA, UK and Australia. In 2007, I founded my first business, developing complex web applications for business owners and helping them to market their online businesses through search engines. In 2016, I am celebrating my 21 years of Programming Experience.
My overall approach to teaching is to expose students to their potentials. I am an excellent communicator who believes in fostering learning strengths across different diverse groups of students. I teach programming, apps development, databases and communication skills. Stay Hungry. Stay Foolish.
Hi! I’m Paulo. I have a degree in Computer Science from Whitworth University, and I am a programming geek and very proud of it! I have extensive experience in Android App Development particularly in the Mobile App (Android and iOS) and Web Development. I am also the founder of Magadistudio, a mobile app development company based in the beautiful Inland Northwest (WA). I am passionate about teaching people Android app development. Showing them the ropes of making amazing android applications is an extremely rewarding experience! My goal is to get you up and running, quickly, making android apps. You wouldn’t believe the freedom that being an Android developer offers. I genuinely believe this course is the best in the market (on Android development) and if you don’t agree, I’ll gladly refund your money.
Instructor Other Courses:
Learn Swift Programming From Scratch – No MAC Required Fahd Sheraz, Android Developer, iOS Developer and Teacher (24) $10 $20 Learn Swift Programming From Scratch – No MAC Required Fahd Sheraz, Android Developer, iOS Developer and Teacher (24) $10 $20 The Complete iOS 9 & Swift Developer Course – Build Apps The Complete iOS 9 & Swift Developer Course – Build Apps Java – The Java Programming Language Course Java – The Java Programming Language Course …………………………………………………………… Fahd Sheraz Paulo Dichone coupons Development course coupon Udemy Development course coupon Mobile Apps course coupon Udemy Mobile Apps course coupon The Complete Android & Java Developer Course – Build 21 Apps The Complete Android & Java Developer Course – Build 21 Apps course coupon The Complete Android & Java Developer Course – Build 21 Apps coupon coupons
The post 95% off #The Complete Android & Java Developer Course – Build 21 Apps – $10 appeared first on Udemy Cupón/ Udemy Coupon/.
from Udemy Cupón/ Udemy Coupon/ http://coursetag.com/udemy/coupon/95-off-the-complete-android-java-developer-course-build-21-apps-10/ from Course Tag https://coursetagcom.tumblr.com/post/155398840103
0 notes
Text
List of arrays in java
In this article, we will take a look at creating list of arrays in java with examples and explanation. A java array is a collection of elements and a list is also a collection of elements. Difference between the two is that an array is of fixed size while a list is dynamic, meaning it can grow and shrink in size when required. List of array means that each element of a list is an array. It can be visualized as below. Each index or position of the list points to an array. Indexes which do not point to any array or are empty are set to null. Example program public class ListOfArrayExample { public static void main(String args) { // create a list of arrays List numbers = new ArrayList(); // create integer arrays Integer arrOne = {1,2,3,4}; Integer arrTwo = {5,6,7,8}; // add to list numbers.add(arrOne); numbers.add(arrTwo); // iterate over list for (Integer array : numbers) { System.out.println(Arrays.toString(array)); } } } Explanation Above example creates a list which shall hold elements of type Integer(array of integers) as List numbers = new ArrayList(); This means that each of its index will point to an integer array. Remember that List is an interface and ArrayList is its implementation class. Next, initialize two integer arrays and add them to the list with its add() method. Finally, iterate over the list using enhanced for loop. Read the full article
0 notes
Text
April 14th 2020
Today I think I’m gonna make an actual inventory system for the player in the Sun’s script since it’s gonna persist between scenes. I think the most difficult part is gonna be figuring out what kind of array to make it, but I’m assuming that I’ll probably just have it use an integer system with each item being associated to a specific number; So after doing a bit of groundwork setup (establishing variables, assigning integer values to different items that can be bought) I’ve realized I’m going to have to do a bit of brushing up on how arrays work, especially in c#, we don’t have a limit on the inventory space yet so I’m just going to try and get an array set up that increases in size every time you obtain an item so there isn’t any unnecessary wasted memory on the unused inventory slots, but if I remember correctly from my java class I might end up having to use an arraylist instead so that the size can be manipulated easier; okay so it looks like if we wanted a changeable size inventory system I’d have to make a new list every time, move the items over to the new list, and replace the original list with the new one, so instead I’m just going to set the size of the inventory to 40 because I doubt we’ll need much more space than that if any, Alright so I think I got something figured out a good system for moving items into the player’s inventory and while I would love to explain it in great detail through normal people speak I’d rather just put the code for the function I wrote here under the “read more” hopefully all I’ll have to do is tie the buttons in the shopkeeper UIs to call the sun’s GiveItem function and it’ll give the item to the player, and take the right amount of money
public void GiveItem(int moneyToTake, int itemToAdd) { var hasGiven = false; if (moneyToTake <= Money) { Money -= moneyToTake; } if(!hasGiven) { for (int i = 0; i < Items.Length - 1; i++) { if(Items[i] == 0) { Items[i] = itemToAdd; hasGiven = true; } } } }
0 notes
Link
Learn Android Development, Java & Android Studio from Scratch in 5 Weeks. Build a Diary App & more
What you’ll learn
Learn Android development, Java programming and Android studio from scratch
Learn Java programming from a professional trainer from your own desk
Create fun, engaging and real world Android apps (using Java) you can show to your friends and family
Learn how to work with APIs, web services and advanced databases
Visual training method, offering users increased retention and accelerated learning
Have all the tools you need to successfully design, code and sell your Android apps
Breaks even the most complex applications down into simplistic steps
Build Whatsapp clone, Diary app, Temperature convertor app, Mood scanner app & much more
Upload your android apps to the Google play and reach millions of android users
Earn money by Monetising your android apps – By displaying ads
Build 21 different Android and Java apps from scratch
Requirements
This course is highly recommended for you if you’ve never written a line of code
No programming experience is required
A PC or MAC with internet connection
Passion for learning android app development with Java
Description
PLEASE READ BEFORE ENROLLING:
1.) THERE IS AN UPDATED VERSION OF THIS COURSE:
“THE COMPREHENSIVE 2019 ANDROID DEVELOPMENT MASTERCLASS”
CLICK ON MY PROFILE TO FIND IT. (PLEASE WATCH THE FIRST PROMO VIDEO ON THIS PAGE FOR MORE INFO)
**********************************************************************************************************
****Over 60,000 Happy and Satisfied Students and counting ****
Android App Development will open many doors for you, especially if you are looking to becoming a full-fledged app developer.
If you’re Looking to boost your income as an Android Developer? Maybe you have a lot of app ideas but don’t know where to start? Or you are seeking a career in Android Development and Java Programming that will finally give you freedom and flexibility you have been looking for?
Build a strong foundation in Android Development, Android Studio and object-oriented Java Programming with this tutorial and complete course.
Build Android apps from scratch using Android Studio and Java Programming Language
Upload your apps to Google Play and reach Millions of Android users
Content and Overview
This course will take you from knowing nothing about Android development to a complete Android developer in 5 weeks. You will learn the following:
Android Studio and build User Interface (Set up and walkthrough)
Fundamentals of Java Programming used to build Android apps
Inputs, Buttons and Reactive (Tap) Interfaces
Android Building blocks
Variables, Arrays, Loops, ArrayLists, ListView
Navigate between screens
Passing information between screens
Learn how professional android apps developers think and work
Learn how to design android apps
Build several amazing apps – Hands on
Publish your apps on Google Play
Build Sound Box app
And Learn much more by Building 21 Real World Apps …
WHY ANDROID?
Android is known to be one of the most versatile and most used operating systems. We are in the age where every other person uses a handheld device or a cell phone which makes use of Android. If one goes deep into the world of android, we would see that there is a scope and a lot of potential in the world of android for individuals who are tech geeks (like us)! As vast this world this, learning about it as simple and as easy as a piece of cake. You can make your own app easily and show your true potential to the world of google and android.
Here are some numbers to get you in the mood!
DID YOU KNOW? Android is the primary operating system for over 90 tablets, for 6 E-Readers and 300 smartphones. There are over 1,460,800 apps in Google Play store &they’re growing at an astounding pace! Every day about 1.5 million Android devices are activated all around the world. About 60% of the apps available at the Google play store are absolutely free!
Why learn android development? Learning android development is both fun and can reap you many profits in the long run. It is said that by the year 2018, there will be about 4 billion android users, hence doubling the current market. It is safe to say that android development has a potential and can reap you various benefits in the long run. If one knows android development, not only will you be having a stable and sound career but can unleash you hidden talents as a developer.
if you take this course (which you should!!) know that you are on your way to building a solid and stable foundation for Android Development, Android Studio and object-oriented Java Programming. You don’t need to spend years learning, with us you can learn in 5 weeks!!!! YES! That is right, in five weeks you’ll be able to make and develop your own app and you never know, you could have it running at the app store and be an instant hit!
The course is structured in such way to improve your knowledge retention – by having a lot of hands-on projects. In each section of the course, you will be given the opportunity to practice and build something meaningful which will aid your understanding of Android Development even further. There are quizzes and challenges as well.
BEGINNERS ARE WELCOME!
If you are not an experienced developer, don’t worry. This course was designed with beginners in mind – you don’t have to have any prior experience at all!
All you need is an open mind and willing to work
What do I learn from this course?
You will be able to learn android app development and Java programming in just 5 weeks.
You can create engaging and real-world Android apps (which you can later show off to your family and friends).
You will be learning the course by building 21 apps that include big buzz word apps such as the popular Whatsapp clone, calculator, YouTube video player, a mood setter application.
This course is offered via visual training that engages students and has a better chance of retention. You will have a personal trainer at your desk at all times that will guide you.
We aren’t finished! You can learn how to work with APIs, web services and advanced databases Upload your android apps to the Google play and reach millions of android users and EARN MONEY by monetizing your applications and allowing advertisements to run on them!
Why Take This Course? We are passionate about android, we breathe, live Android! We have been in the industry for more than a decade and along with our knowledge, we can teach you with hands on experience. We have a decade of experience in our bags of solid programming experience along with five years of application development experience. Our experience can be measured by us having over fifty applications and games (developed by us) on not only the Android Google Play but also on the Apple App Store. You’ll be taught by people who have more than 5 years of training and teaching experience, are Registered Android Developers on Google Play and manage a large community that consists of more than 10,000 Developers.
We are dedicated teachers and want to spread the joy of programming and building apps. Our joy of programming shows throughout the entire course, and it’s our hope that you find programming joyful and valuable.
Don’t just take our word for it, see what my past students had to say about the course:
“I liked the course and the professor, I’m taking another course with him because he’s very good in my opinion, starts from beginner to advanced, very organized classes. A lot of examples in the course, and he was updating the course often too. Money well spent.” – Kevin
“Great course. very easy in understanding and friendly learning. Good Job Sir. Thanks for this.” – Muhammad
“Well, in my opinion this is a great course since i knew nothing about java and by now im able to write my own apps pretty easily.” – Michael
“Great course! I learned lots from the numerous examples. I now have the confidence to build my own apps and to explore different areas of Android programming.
Great Course!!!! Thanks Paulo!!!!!” – Ian
“I am very satisfied with this course. I have only attended the Android part because I had a basic knowledge on Java. I really like how Paulo teaches. He goes step by step and you can understand everything. My first language is not english, but he speaks very clearly, I can understand every word. Also, he is a happy guy, and you can hear that through the courses that he really loves what he is doing.” – Antal
“Very well thought-out course. Flows smoothly with great delivery. I have been developing Android Apps for several years and I still found this course to be informative, relevant, and helpful. I would recommend everyone take this course if you are new to Android or returning for a refresher course.” – Douglas
So what are you waiting for? Click the buy now button and join the world’s most highly rated Android Developer Course.
Enroll now.
Who this course is for:
Recommended for people with no programming or app developer experience
Suitable for beginner programmers
Best course for Web / iOS developers or any programmers who want to learn android development
Software developers who need to architect, create and deploy commercial applications on Google’s Android platform
Entreprenueres who want to learn app development and save money on development & outsourcing
Created by Paulo Dichone, Fahd Sheraz Last updated 4/2019 English English [Auto-generated]
Size: 5.58 GB
Download Now
https://ift.tt/1NB9ABO.
The post The Complete Android & Java Developer Course – Build 21 Apps appeared first on Free Course Lab.
0 notes
Text
Computer Software Training Courses for 2019
This is the era of technology. Everywhere you go you find technology in the form of computer, mobile phones, satellite etc. Even in your workspace also. So, you need some kind of familiarity with them. For example, you need to handle a computer in your office, android phone, and scanner and even with a coffee machine as you are surrounded by technologies. But this blog is not about all of them it is about Information Technology.
Today in the market you find a lot of institutes who offer IT training courses. These courses may include the following:-
Web development
Web Designing
Digital Marketing
App Development
Hardware & Networking
System Analyst
DBA (Database administrator)
Cloud Technology
Software Development
AI (Artificial Intelligence) etc…
But if you have made your mind to build your career in Computer Software then ZENITECH is the best institute for you to start with as this offers various computer courses. The list of the courses is as follows:-
Embedded System Training
C/C++ Training
JAVA
C#ASP.NET
Python
Linux
Web Development
IOT
VHDL
Embedded System Training:
1) The basics of embedded systems, the basic computer architecture, voltage and current, pull down & pull up registers etc.
2) Basic intro to ARM Cortex M
3) Intro to Assembly language
4) Basics of C language
5) LCD controllers, pinout, interfacing, data transfer.
6) Intro to Beaglebone Black
7) OS Fundamentals (Linux)
C/C++ Training:
C is a very beginner and basic computer programming language. In this course, we cover the following parts:-
1) Basics of C (Variables, Data Types, Control structure, input, output, header files etc)
2) Data Structure (Lists, Stack, Queue, Tree Heap, sorting algorithms etc)
3) Tree
4) Basics of C++ (Classes, Objects, Methods, Constructors, Operators, Inheritance, Polymorphisms etc).
5) STL (Standard Template Library)
6) Multithreading (Deadlock, Thread Management)
7) Design Patterns
8) C++11, C++14, C++17
JAVA
JAVA is a very popular and demanding programming language. This course contains the following sections:-
1) Core JAVA (First java program with the console and with Eclipse, Data Types, variables, Literals, Arrays, Class, methods, Operators, Statements etc)
2) JAVA Exceptions (Types of Exceptions, Defining and Throwing Exceptions, Assertions etc)
3) Java Strings
C#ASP.NET
.NET is a free platform for building many different types of apps with multiple languages. You can build apps for web, mobile, desktop, gaming, and IoT. C#, F# and VB (Visual Basic) are the languages that are used to write .NET programs. This course contains:-
1) An intro of C# (What is .NET, CLR, Namespaces, Statements, Expressions, Operators, Defining Types, Classes)
2) Encapsulation, Directional Dependencies, Method Overloading, Properties, Events etc.
3) Control and Exceptions (Looping, Re-throwing Exceptions)
4) C# and the CLR
5) C# and Generics (Generic Collections, Generic Parameters, Generic Constraints, Generic Methods)
6) C# and LINQ (Extension Methods)
7) Prime Abstraction, Multithreading, Resource management, ArrayList, Hashtable, SortedList, Stack and Queue
8) ADO.NET
9) WPF (Windows Presentation Foundation) includes Windows Application using WPF, Data Binding, Data Template, Styles, Commands etc.
10) ASP.NET (ASP.NET Architecture, Data Binding, Validation, Config file encryption, Custom Controls, ASP.NET Ajax Server Data)
11) C# 6, C# 7
Python
Python is free and easy to learn a computer programming language. In this course first, we tell you how to install the Python interpreter on your computer as this is the program that reads Python programs and carries out their instructions. There are 2 versions of Python: Python 2 and Python 3. Our course contains the following sections:-
1) Python Basics (What is Python, Anaconda, Spyder, Integrated Development Environment (IDE), Lists, Tuples, Dictionaries, Variables etc)
2) Data Structures in Python (Numpy Arrays, ndarrays, Indexing, Data Processing, File Input and Output, Pandas etc)
Linux
According to Wikipedia,
“Linux is a family of free and open-source software operating systems based on the Linux kernel.”
Linux is the leading OS on servers and other big iron systems such as mainframe computers, and TOP500 supercomputers. It is more secure Os as compared to the other OS(s) like Windows. Our Linux course contains the following sections:-
1) Linux Basics (Utilities. File handling, Process utilities, Disk utilities, Text Processing utilities and backup utilities etc).
2) Sed and Awk (awk- execution, associative arrays, string and mathematical functions, system commands in awk, applications. etc)
3) Shell Programming/ scripting (Shell programming with bash, Running a shell script, The shell as a programming language, Shell commands, control structures, arithmetic in the shell, interrupt processing, functions, debugging shell scripts)
4) Files and Directories (File Concept, File types, File system Structure, File metadata, open, create, read, write, lseek etc)
5) Processes and Signals (Process concepts, the layout of C program image in main memory, process environment, Introduction to signals, Signal generation and handling etc)
6) Inter-Process Communication (IPC), Message Queues, Semaphores(Introduction to IPC, IPC between processes on a single computer, on different systems etc)
7) Shared Memory (Kernel support for Shared memory, APIs for shared memory)
8) Socket TCP IP Programming (Introduction to Berkeley Sockets, IPC over a network, client/server model etc)
9) Linux Kernel (Linux Kernel source, Different kernel subsystems, Kernel Compilation etc)
10) Linux Device Driver (Major and Minor numbers, Hello World Device Driver, Character Device Driver, USB Device Driver etc)
So, these are the computer software training courses offering by ZENITECH. To enroll yourself for any of the following course you can call us @ 9205839032, 9650657070.
Thanks,
0 notes
Text
48 C# Interview Questions Any Interview Worth Their Salt Will Ask
With over 7,000 C#.Net programming jobs advertised every month that have an average salary of over $90,000, the demand for this type of developer has exploded. But why is the C#.Net labor market so hot right now? Well, more and more engineering departments are adopting C#.Net to build their software because it's similar to other common C-type languages like C++ and Java. This makes the language intuitive to learn -- in fact -- it's the fifth most popular programming language for building software.
To help you prepare for your next C#.Net developer interview and land the job, check out the following C#.Net interview questions most interviewers will ask you.
48 C#.Net Interview Questions
1. What is C#?
2. What are the advantages of using C#?
3. What are an object and class?
4. What is an Object Pool?
5. What is an abstraction?
6. What is polymorphism?
7. Is C# managed or unmanaged code?
8. How do you inherit a class in C#?
9. What’s the difference between Interface and Abstract Class?
10. What are sealed classes in C#?
11. What’s the difference between a struct and a class in C#?
12. What’s the point of using statement in C#?
13. How is Exception Handling applied in C#?
14. What are boxing and unboxing in C#?
15. What are the three types of comments in C#?
16. Can multiple catch blocks be executed in C#?
17. What’s the difference between static, public, and void? What’s the outcome of each one?
18. What are value types and reference types?
19. What’s the difference between ref and out parameters?
20. Can “this” be used within a static method?
21. What are Arrays in C#?
22. What is a jagged array in C#?
23. What’s the difference between Array and ArrayList?
24. What’s the difference between System.Array.CopyTo() and System.Array.Clone()?
25. What’s the difference between string and StringBuilder?
26. What are delegates in C#?
27. What’s a multicast delegate?
28. What is a Reflection in C#?
29. What is a Generic Class?
30. What are Get and Set Accessor properties?
31. What is Multithreading?
32. What is Serialization?
33. What are the different ways a method can be overloaded?
34. What is the accessibility modifier “protected internal”?
35. What are the different ways a method can be overloaded?
36. What is an object pool in .Net?
37. What are the most commonly used types of exceptions in .Net?
38. What are accessibility modifiers in C#?
39. What are nullable types in C#?
40. What’s the difference between is and as operators in C#?
41. What are Indexers?
42. What are Singleton Design Patterns?
43. Given an array of ints, write a C# method to total all the values that are even numbers.
44. Is it possible to store mixed data types like int, string, float, and char all in one array?
45. Describe dependency injection.
46. Write a C# program that accepts a distance in kilometers, converts it into meters, and then displays the result.
47. What’s the difference between the “constant” and “readonly” variables when using C#? When would you use each one?
48. Which preference of IDE do you have when using C#? Why?
0 notes
Text
Difference between length of Array and size of ArrayList in Java https://t.co/Z2NVQ5Y8nb
Difference between length of Array and size of ArrayList in Java https://t.co/Z2NVQ5Y8nb
— Dave Epps (@dave_epps) November 5, 2018
from Twitter https://twitter.com/dave_epps
0 notes
Text
Java Collections Interview Questions and Answers
Here are some Java Collections Interview Questions and Answers to prepare your interview.
Java Collections Framework is the fundamental aspect of java programming language. It’s one of the important topic for java interview questions. Here I am listing some important java collections interview questions and answers for helping you in interview.
Here is the list of mostly asked java collections interview questions with answers.
1. What is difference between ArrayList and vector?
1) Synchronization – ArrayList is not thread-safe whereas Vector is thread-safe. In Vector class each method like add(), get(int i) is surrounded with a synchronized block and thus making Vector class thread-safe.
2) Data growth – Internally, both the ArrayList and Vector hold onto their contents using an Array. When an element is inserted into an ArrayList or a Vector, the object will need to expand its internal array if it runs out of room. A Vector defaults to doubling the size of its array, while the ArrayList increases its array size by 50 percent.
2. How can Arraylist be synchronized without using Vector?
Ans) Arraylist can be synchronized using:
Collection.synchronizedList(List list)
Other collections can be synchronized:
Collection.synchronizedMap(Map map) and Collection.synchronizedCollection(Collection c)
3. If an Employee class is present and its objects are added in an arrayList. Now I want the list to be sorted on the basis of the employeeID of Employee class. What are the steps?
Ans) 1) Implement Comparable interface for the Employee class and override the compareTo(Object obj) method in which compare the employeeID
2) Now call Collections.sort() method and pass list as an argument.
Now consider that Employee class is a jar file.
1) Since Comparable interface cannot be implemented, create Comparator and override the compare(Object obj, Object obj1) method .
2) Call Collections.sort() on the list and pass comparator as an argument.
4. What is difference between HashMap and HashTable?
Both collections implements Map. Both collections store value as key-value pairs. The key differences between the two are
Hashmap is not synchronized in nature but hshtable is.
Another difference is that iterator in the HashMap is fail-safe while the enumerator for the Hashtable isn’t. Fail-safe– “if the Hashtable is structurally modified at any time after the iterator is created, in any way except through the iterator’s own remove method, the iterator will throw a ConcurrentModificationExceptionâ€?
3. HashMap permits null values and only 1 null key, while Hashtable doesn’t allow key or value as null.
5. What are the classes implementing List interface?
There are three classes that implement List interface: 1) ArrayList : It is a resizable array implementation. The size of the ArrayList can be increased dynamically also operations like add,remove and get can be formed once the object is created. It also ensures that the data is retrieved in the manner it was stored. The ArrayList is not thread-safe.
2) Vector: It is thread-safe implementation of ArrayList. The methods are wrapped around a synchronized block.
3) LinkedList: the LinkedList also implements Queue interface and provide FIFO(First In First Out) operation for add operation. It is faster if than ArrayList if it performs insertion and deletion of elements from the middle of a list.
6. Which all classes implement Set interface?
Ans) A Set is a collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element. HashSet,SortedSet and TreeSet are the commnly used class which implements Set interface.
SortedSet – It is an interface which extends Set. A the name suggest , the interface allows the data to be iterated in the ascending order or sorted on the basis of Comparator or Comparable interface. All elements inserted into the interface must implement Comparable or Comparator interface.
TreeSet – It is the implementation of SortedSet interface.This implementation provides guaranteed log(n) time cost for the basic operations (add, remove and contains). The class is not synchronized.
HashSet: This class implements the Set interface, backed by a hash table (actually a HashMap instance). It makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time. This class permits the null element. This class offers constant time performance for the basic operations (add, remove, contains and size), assuming the hash function disperses the elements properly among the buckets
7. What is difference between List and a Set?
1) List can contain duplicate values but Set doesnt allow. Set allows only to unique elements. 2) List allows retrieval of data to be in same order in the way it is inserted but Set doesnt ensures the sequence in which data can be retrieved.(Except HashSet)
8. What is difference between Arrays and ArrayList ?
Ans) Arrays are created of fix size whereas ArrayList is of not fix size. It means that once array is declared as :
int [] intArray= new int[6];
intArray[7] // will give ArraysOutOfBoundException.
Also the size of array cannot be incremented or decremented. But with arrayList the size is variable.
Once the array is created elements cannot be added or deleted from it. But with ArrayList the elements can be added and deleted at runtime.
List list = new ArrayList(); list.add(1); list.add(3); list.remove(0) // will remove the element from the 1st location.
ArrayList is one dimensional but array can be multidimensional.
int[][][] intArray= new int[3][2][1]; // 3 dimensional array
To create an array the size should be known or initalized to some value. If not initialized carefully there could me memory wastage. But arrayList is all about dynamic creation and there is no wastage of memory.
9. When to use ArrayList or LinkedList ?
Ans) Adding new elements is pretty fast for either type of list. For the ArrayList, doing random lookup using “get” is fast, but for LinkedList, it’s slow. It’s slow because there’s no efficient way to index into the middle of a linked list. When removing elements, using ArrayList is slow. This is because all remaining elements in the underlying array of Object instances must be shifted down for each remove operation. But here LinkedList is fast, because deletion can be done simply by changing a couple of links. So an ArrayList works best for cases where you’re doing random access on the list, and a LinkedList works better if you’re doing a lot of editing in the middle of the list.
10. Consider a scenario. If an ArrayList has to be iterate to read data only, what are the possible ways and which is the fastest?
Ans) It can be done in two ways, using for loop or using iterator of ArrayList. The first option is faster than using iterator. Because value stored in arraylist is indexed access. So while accessing the value is accessed directly as per the index.
11. Now another question with respect to above question is if accessing through iterator is slow then why do we need it and when to use it.
Ans) For loop does not allow the updation in the array(add or remove operation) inside the loop whereas Iterator does. Also Iterator can be used where there is no clue what type of collections will be used because all collections have iterator.
12. Which design pattern Iterator follows?
Ans) It follows Iterator design pattern. Iterator Pattern is a type of behavioral pattern. The Iterator pattern is one, which allows you to navigate through a collection of data using a common interface without knowing about the underlying implementation. Iterator should be implemented as an interface. This allows the user to implement it anyway its easier for him/her to return data. The benefits of Iterator are about their strength to provide a common interface for iterating through collections without bothering about underlying implementation.
Example of Iteration design pattern – Enumeration The class java.util.Enumeration is an example of the Iterator pattern. It represents and abstract means of iterating over a collection of elements in some sequential order without the client having to know the representation of the collection being iterated over. It can be used to provide a uniform interface for traversing collections of all kinds.
13. Is it better to have a HashMap with large number of records or n number of small hashMaps?
Ans) It depends on the different scenario one is working on: 1) If the objects in the hashMap are same then there is no point in having different hashmap as the traverse time in a hashmap is invariant to the size of the Map. 2) If the objects are of different type like one of Person class , other of Animal class etc then also one can have single hashmap but different hashmap would score over it as it would have better readability.
14. Why is it preferred to declare: List<String> list = new ArrayList<String>(); instead of ArrayList<String> = new ArrayList<String>();
Ans) It is preferred because:
If later on code needs to be changed from ArrayList to Vector then only at the declaration place we can do that.
The most important one – If a function is declared such that it takes list. E.g void showDetails(List list); When the parameter is declared as List to the function it can be called by passing any subclass of List like ArrayList,Vector,LinkedList making the function more flexible
15. What is difference between iterator access and index access?
Ans) Index based access allow access of the element directly on the basis of index. The cursor of the datastructure can directly goto the ‘n’ location and get the element. It doesnot traverse through n-1 elements.
In Iterator based access, the cursor has to traverse through each element to get the desired element.So to reach the ‘n’th element it need to traverse through n-1 elements.
Insertion,updation or deletion will be faster for iterator based access if the operations are performed on elements present in between the datastructure.
Insertion,updation or deletion will be faster for index based access if the operations are performed on elements present at last of the datastructure.
Traversal or search in index based datastructure is faster. ArrayList is index access and LinkedList is iterator access.
16. How to sort list in reverse order?
Ans) To sort the elements of the List in the reverse natural order of the strings, get a reverse Comparator from the Collections class with reverseOrder(). Then, pass the reverse Comparator to the sort() method.
List list = new ArrayList(); Comparator comp = Collections.reverseOrder(); Collections.sort(list, comp)
17. Can a null element added to a Treeset or HashSet?
Ans) A null element can be added only if the set contains one element because when a second element is added then as per set defination a check is made to check duplicate value and comparison with null element will throw NullPointerException. HashSet is based on hashMap and can contain null element.
18. How to sort list of strings ,case insensitive?
Ans) using Collections.sort(list, String.CASE_INSENSITIVE_ORDER);
19. How to make a List (ArrayList,Vector,LinkedList) read only?
Ans) A list implemenation can be made read only using Collections.unmodifiableList(list). This method returns a new list. If a user tries to perform add operation on the new list; UnSupportedOperationException is thrown.
20. What is ConcurrentHashMap?
Ans) A concurrentHashMap is thread-safe implementation of Map interface. In this class put and remove method are synchronized but not get method. This class is different from Hashtable in terms of locking; it means that hashtable use object level lock but this class uses bucket level lock thus having better performance.
21. Which is faster to iterate LinkedHashSet or LinkedList?
Ans) LinkedList.
22. Which data structure HashSet implements?
Ans) HashSet implements hashmap internally to store the data. The data passed to hashset is stored as key in hashmap with null as value.
23. Arrange in the order of speed – HashMap,HashTable, Collections.synchronizedMap, concurrentHashmap ?
Ans) HashMap is fastest, ConcurrentHashMap,Collections.synchronizedMap,HashTable.
24. What is identityHashMap?
Ans) The IdentityHashMap uses == for equality checking instead of equals(). This can be used for both performance reasons, if you know that two different elements will never be equals and for preventing spoofing, where an object tries to imitate another.
25. What is WeakHashMap?
Ans) A hashtable-based Map implementation with weak keys. An entry in a WeakHashMap will automatically be removed when its key is no longer in ordinary use. More precisely, the presence of a mapping for a given key will not prevent the key from being discarded by the garbage collector, that is, made finalizable, finalized, and then reclaimed. When a key has been discarded its entry is effectively removed from the map, so this class behaves somewhat differently than other Map implementations.
#Java Collections Interview Questions and Answers#Java Collections Interview Questions#java interview questions#Java tutorials#india
0 notes
Photo
9 differences between Array and ArrayList in #Java https://t.co/1texdaHdIj #Java #JavaEE #Java9
0 notes
Text
Advanced Selenium Training in Bangalore
KRN INFORMATIX is a stop shop for software testing training services .This institute provides young job aspirants, the perfect launch-pad to build a gratifying career in the growing IT sector .Besides training, we also provide placement assistance to our students and most of the big corporate in the corporate world will hire our trained talent. Among all the trainees in KRN INFORMATIX,100% of the trainees are working as IT professionals in various MNCs .This indicates clearly that the KRN INFORMATIX teaching methodology is beyond the industry standards. We have helped Fresher’s, Software Engineers, Working Professionals, business leaders, Corporate Companies and individuals incorporate the Knowledge in to their Minds through hands-on Real time training.
Selenium is a portable software testing framework for web applications.
Selenium provides a record/playback tool for authoring tests without learning a test scripting language ().It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala.
The tests can then be run against most modern web browsers. Selenium deploys on Windows, Linux, and OS X platforms. It is open-source software, released under the Apache 2.0 license, and can be downloaded and used without charge.
JAVA FOR SELENIUM
Selenium Overview
Installing Java
Installing Eclipse
Features of Java
Why Java for Selenium
First Eclipse Project
First Java program
Concept of class file
Platform Independence
Datatypes in Java
String class
If statements
Conditional and concatination operators
Mille Loop
For Loops
Practical Examples with loops
Usage of loops in Selenium
40. Single Dimensional Arrays
Two Dimnsional arrays
Practical usage of arrays in Selenium
Drawbacks of arrays
What are Functions?
Function Input Parameters
Function Return Types
Local Variables
Global Variables
Static and Non-Static Variables
Static and Non-Static Functions
Creating Objects in Java
Meaning of static
Why Is main method static?
Object and Object References
Call by reference and Value
Constructors
Usage of Objects In Selenium
Concept of Inheritance
Interface
Overloadings and Overriding Funtions
Example on inheritance
Object Class
Usage of Inheritance in Selenium
Relevence of Packages
Creating Packages
Accessing Classes Across Packages
Good Features of eclipse
Accessing modifiers - Public, Private, Default, Protected
Exception hading with try catch block
Importance of exception handling
Exception and Error
Throwable Class
Final and Finally
Throw and Throws
Different Types of Exceptions
Need of exception handling in Selenium framework
Introduction to Collections API
ArrayList Class
HashTable Class
String class and functions
Reading/Writing Text Files
Reading Properties File in Java
Concept of jar file
ReadingiWrIfing Microsoft XLS Flies
SELENIUM IDE
Intalling Selenium IDE
Recording Script
Running, Pausing and debugging Script
Running a script line by line
Inserting commands in between script
XPATHS and installing firebug to get XPATHS
Wait Commands
Verification and Assertions
Should I use verify or assertion
JavaScript
User-extension.js in Selenium IDE
SELENIUM WEBDRIVE
Why WebDriver?
Downloading WebDriver Jars and configuring in eclipse
Architecture of selenium webdriver
Drivers for Firefox, 1E, chrome, !phone, Android etc
First Selenium Code
Working with chrome and IE
Selenium RC and WebDriver
Concept of firefox profile
What is Firefox profile
Why we need tirefox Profile
Close and Quit -Difference
Importing webdriver documentation in eclipse
WebDriver i DesiredCapabilities Class
Proxy settings with webdriver/Working with proxy Servers
HTMLUnit driver and desired capabilities
Firepath and firebug Add-ons installation in Mozilla
Inspecting elements in Mozilla, Chrome and IE
HTML language tags and attributes
Various locator strategies
WebDriver Interface
WebElement Interface
Identifying WebElements using id, name, class
Finding Xpaths to Identify
Absolute and complete Xpaths
Creating customized Xpaths without firebug
Css Selectors
Generating own CssSelectors
Performance of CssSelectors as compared to )(paths
Finding xpaths/cssselectors in different browsers - Mozilla,
Chrome and IE
Objects with same idixpathicssSelector
What is class attribute?
Handling Dynamic objects/ids on the page
Working with different browsers without changing code
Managing Input fields, Buttons and creating custom xpaths
Managing/Identifying Links with xpathslcss selectors
Extracting More than one object from a page
Extracting all links of a page/Bulk extraction of objects
xtracting Objects from a specific area of a web page
Various strategies to test Links on a page by clicking on them one by one
Finding whether object Is present on page or not
Handling drop down list
Select Class in Selenium API
Managing radio buttons and Checkboxes
Hidden components
isDisplayed function
Taking Screenshots of the web page
READ MORE
MORE TAGS:
Cucumber Training in Bangalore | Selenium Software Training in Bangalore | Selenium Training in Bangalore | Selenium Training Institutes in Bangalore | Best Selenium Training in Bangalore | Selenium Training in Marathahalli | Automation Testing Training in Bangalore | Best Selenium Training Institute in Bangalore | Software Testing Training in Bangalore
0 notes