This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.amit.problemsolving; | |
import java.util.Arrays; | |
public class ReverseArray { | |
public static void main(String[] args) { | |
int[] a = {1,2,3,4,5,6,7}; | |
int[] b = {1,2,3,4,5,6,7}; | |
// reverseArray(a,0,a.length-1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void updateData(Data data) { | |
if (data == null) { | |
return; | |
} else if (data.isPresent()) { | |
// do stuff here | |
} else { | |
trow new Exception(msg); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TypeClassesExample extends App { | |
case class User(name: String, age: Int, city: String) | |
trait Equality[T] { | |
def isEqual(left: T, right: T): Boolean | |
} | |
object Equality { |