Wipro TalentNext Assessment 2 - Java Quick Notes
Logic Building
- Control Statements: if, else, switch, loops (for, while, do-while)
- Problem Solving: Use flowcharts, dry run, and pseudocode to solve logic-based problems.
- Patterns: Triangle, pyramid, number patterns using nested loops.
Coding Standards/Best Practices
- Meaningful variable/method/class names (camelCase, PascalCase)
- Proper indentation and spacing
- Avoid hardcoding values
- Use constants where applicable
- Comments for complex logic
- Follow SOLID principles (basics only)
JUnit (Basics)
- Used for unit testing in Java.
- Annotation-based:
- @Test - marks a method as test
- @Before / @After - runs before/after each test
- Use assertEquals(expected, actual) for validating output
Multithreading
- Java threads can be created via:
- Extending Thread class
- Implementing Runnable interface
- start() method launches a thread
- Thread states: New, Runnable, Running, Blocked, Terminated
- Synchronization used to prevent thread interference
RDBMS / SQL / JDBC
- SQL Queries: SELECT, INSERT, UPDATE, DELETE, JOIN, GROUP BY, ORDER BY
- Constraints: PRIMARY KEY, FOREIGN KEY, NOT NULL, UNIQUE, CHECK
- JDBC Steps:
1. Load driver ([Link])
2. Establish connection ([Link])
3. Create statement
4. Execute query
5. Close connection