diff --git a/Adv_WEB_TECH.zip b/Adv_WEB_TECH.zip new file mode 100644 index 000000000000..94a72225b777 Binary files /dev/null and b/Adv_WEB_TECH.zip differ diff --git a/ISEC_3i_files.zip b/ISEC_3i_files.zip new file mode 100644 index 000000000000..9c3077615558 Binary files /dev/null and b/ISEC_3i_files.zip differ diff --git a/J2SE_Interview_Quest.zip b/J2SE_Interview_Quest.zip new file mode 100644 index 000000000000..6224adabc954 Binary files /dev/null and b/J2SE_Interview_Quest.zip differ diff --git a/Java8 Features.txt b/Java8 Features.txt new file mode 100644 index 000000000000..66ccf2266162 --- /dev/null +++ b/Java8 Features.txt @@ -0,0 +1,15 @@ +Java8 features + + +default methods +static + +lambda expressions + +java fx + +method reference + +stream api + +Nashorn engine \ No newline at end of file diff --git a/Test.java b/Test.java new file mode 100644 index 000000000000..038eeecc1aeb --- /dev/null +++ b/Test.java @@ -0,0 +1,85 @@ +class Node +{ + T val; + Node prev,next; + Node(T val) + { + this.val=val; + } +} +class DoubleLinkList +{ + private Node head,tail; + public int addFront(Node n) + { + if(head == null && tail == null) + head = tail = n; + else + { + tail.next = n; + tail = n; + } + return 0; + } + public int addBack(Node n) + { + if(tail == null && tail == null) + head = tail = n; + else + { + head.prev = n; + head = n; + } + return 0; + } + public int removeFront() + { + /**if(tail == null) + throw new Exception(){}; + else**/ if(head == tail) + head = tail = null; + else + { + tail = tail.prev; + tail.next = null; + } + return 0; + } + public int removeBack() + { + /**if(head == null) + throw new Exception(){}; + else**/ if(head == tail) + head = tail = null; + else + { + head = head.next; + head.prev = null; + } + return 0; + } + public String print() + { + String str = new String(); + str = "["; + Node curr = head; + do + { + str += "\t" + curr.val.toString(); + curr = curr.next; + } + while(curr != null); + str += "]"; + return str; + } +} +public class Test +{ + public static void main(String a[]) + { + DoubleLinkList list = new DoubleLinkList(); + list.addFront(new Node(5)); + list.addFront(new Node(4)); + System.out.println(list.print()); + } +} \ No newline at end of file diff --git a/c++.zip b/c++.zip new file mode 100644 index 000000000000..5b8ec623d49f Binary files /dev/null and b/c++.zip differ diff --git a/dac.zip b/dac.zip new file mode 100644 index 000000000000..91ad207ec103 Binary files /dev/null and b/dac.zip differ diff --git a/java.zip b/java.zip new file mode 100644 index 000000000000..6ad3466ad3a6 Binary files /dev/null and b/java.zip differ diff --git a/offer_letter.pdf b/offer_letter.pdf new file mode 100644 index 000000000000..325ac3a71ac2 Binary files /dev/null and b/offer_letter.pdf differ diff --git a/pracs/Fraction.cpp b/pracs/Fraction.cpp new file mode 100644 index 000000000000..10bf61848886 --- /dev/null +++ b/pracs/Fraction.cpp @@ -0,0 +1,92 @@ +#include + +using namespace std; +class Fraction +{ +private: + int m_numerator; + int m_denominator; + +public: + Fraction(int numerator=0, int denominator=1): + m_numerator(numerator), m_denominator(denominator) + { + // We put reduce() in the constructor to ensure any new fractions we make get reduced! + // Any fractions that are overwritten will need to be re-reduced + cout<<"in constr...."<m_numerator*=f1.m_numerator; + this->m_denominator*=f1.m_denominator; + return *this; +} + Fraction& operator*(int value) +{ + this->m_numerator*=value; + return *this; +} + friend Fraction& operator*(int value, Fraction &f1); + friend istream& operator>>(istream& in, Fraction &f1); + friend ostream& operator<<(ostream& out,const Fraction &f1); + + void print() + { + std::cout << m_numerator << "/" << m_denominator << "\n"; + } +}; + +Fraction& operator*(int value, Fraction &f1) +{ + f1.m_numerator*=value; + return f1; +} +istream& operator>>(istream& in, Fraction &f1) +{ + in>>f1.m_numerator; + in>>f1.m_denominator; + return in; +} +ostream& operator<<(ostream& out,const Fraction &f1) +{ + out<<"("<> f1; + + Fraction f2; + std::cout << "Enter fraction 2: "; + std::cin >> f2; + + std::cout << f1 << " * " << f2 << " is " << f1 * f2 << '\n'; + Fraction f3; + std::cout << "Enter fraction 3: "; + std::cin >> f3; + int num=0; + std::cout << "Enter number : "; + std::cin >> num; + cout< + +using namespace std; +class Cents +{ +private: + int m_cents; + +public: + Cents(int cents) { m_cents = cents;cout<<"in const...:"<m_cents+=value; + return *this; + } + + // add int + Cents using a friend function + friend Cents operator+(int value, const Cents &c1); + + + int getCents() { return m_cents; } +}; + +// note: this function is not a member function! +Cents operator+(int value, const Cents &c1) +{ + // use the Cents constructor and operator+(int, int) + // we can access m_cents directly because this is a friend function + return Cents(c1.m_cents + value); +} + +int main() +{ + Cents c1 = Cents(4) + 6; + Cents c2 = 6 + Cents(4); + + std::cout << "I have " << c1.getCents() << " cents." << std::endl; + std::cout << "I have " << c2.getCents() << " cents." << std::endl; + + return 0; +}